Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see How it Works .
- synthesizeSpeech :: OutputFormat -> Text -> VoiceId -> SynthesizeSpeech
- data SynthesizeSpeech
- ssSpeechMarkTypes :: Lens' SynthesizeSpeech [SpeechMarkType]
- ssSampleRate :: Lens' SynthesizeSpeech (Maybe Text)
- ssTextType :: Lens' SynthesizeSpeech (Maybe TextType)
- ssLexiconNames :: Lens' SynthesizeSpeech [Text]
- ssOutputFormat :: Lens' SynthesizeSpeech OutputFormat
- ssText :: Lens' SynthesizeSpeech Text
- ssVoiceId :: Lens' SynthesizeSpeech VoiceId
- synthesizeSpeechResponse :: Int -> RsBody -> SynthesizeSpeechResponse
- data SynthesizeSpeechResponse
- ssrsRequestCharacters :: Lens' SynthesizeSpeechResponse (Maybe Int)
- ssrsContentType :: Lens' SynthesizeSpeechResponse (Maybe Text)
- ssrsResponseStatus :: Lens' SynthesizeSpeechResponse Int
- ssrsAudioStream :: Lens' SynthesizeSpeechResponse RsBody
Creating a Request
Creates a value of SynthesizeSpeech
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ssSpeechMarkTypes
- The type of speech marks returned for the input text.ssSampleRate
- The audio frequency specified in Hz. The valid values formp3
andogg_vorbis
are "8000", "16000", and "22050". The default value is "22050". Valid values forpcm
are "8000" and "16000" The default value is "16000".ssTextType
- Specifies whether the input text is plain text or SSML. The default value is plain text. For more information, see Using SSML .ssLexiconNames
- List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see PutLexicon .ssOutputFormat
- The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.ssText
- Input text to synthesize. If you specifyssml
as theTextType
, follow the SSML format for the input text.ssVoiceId
- Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
data SynthesizeSpeech Source #
See: synthesizeSpeech
smart constructor.
Request Lenses
ssSpeechMarkTypes :: Lens' SynthesizeSpeech [SpeechMarkType] Source #
The type of speech marks returned for the input text.
ssSampleRate :: Lens' SynthesizeSpeech (Maybe Text) Source #
The audio frequency specified in Hz. The valid values for mp3
and ogg_vorbis
are "8000", "16000", and "22050". The default value is "22050". Valid values for pcm
are "8000" and "16000" The default value is "16000".
ssTextType :: Lens' SynthesizeSpeech (Maybe TextType) Source #
Specifies whether the input text is plain text or SSML. The default value is plain text. For more information, see Using SSML .
ssLexiconNames :: Lens' SynthesizeSpeech [Text] Source #
List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see PutLexicon .
ssOutputFormat :: Lens' SynthesizeSpeech OutputFormat Source #
The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.
ssText :: Lens' SynthesizeSpeech Text Source #
Input text to synthesize. If you specify ssml
as the TextType
, follow the SSML format for the input text.
ssVoiceId :: Lens' SynthesizeSpeech VoiceId Source #
Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the DescribeVoices operation.
Destructuring the Response
synthesizeSpeechResponse Source #
Creates a value of SynthesizeSpeechResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ssrsRequestCharacters
- Number of characters synthesized.ssrsContentType
- Specifies the type audio stream. This should reflect theOutputFormat
parameter in your request. * If you requestmp3
as theOutputFormat
, theContentType
returned is audiompeg. * If you requestogg_vorbis
as theOutputFormat
, theContentType
returned is audioogg. * If you requestpcm
as theOutputFormat
, theContentType
returned is audiopcm in a signed 16-bit, 1 channel (mono), little-endian format. * If you requestjson
as theOutputFormat
, theContentType
returned is audiojson.ssrsResponseStatus
- -- | The response status code.ssrsAudioStream
- Stream containing the synthesized speech.
data SynthesizeSpeechResponse Source #
See: synthesizeSpeechResponse
smart constructor.
Response Lenses
ssrsRequestCharacters :: Lens' SynthesizeSpeechResponse (Maybe Int) Source #
Number of characters synthesized.
ssrsContentType :: Lens' SynthesizeSpeechResponse (Maybe Text) Source #
Specifies the type audio stream. This should reflect the OutputFormat
parameter in your request. * If you request mp3
as the OutputFormat
, the ContentType
returned is audiompeg. * If you request ogg_vorbis
as the OutputFormat
, the ContentType
returned is audioogg. * If you request pcm
as the OutputFormat
, the ContentType
returned is audiopcm in a signed 16-bit, 1 channel (mono), little-endian format. * If you request json
as the OutputFormat
, the ContentType
returned is audiojson.
ssrsResponseStatus :: Lens' SynthesizeSpeechResponse Int Source #
- - | The response status code.
ssrsAudioStream :: Lens' SynthesizeSpeechResponse RsBody Source #
Stream containing the synthesized speech.