TsgcTextToSpeechAmazon › Methods › TextToSpeech
Sends the text to Amazon Polly and stores the synthesized audio in AmazonOptions.FileName.
procedure TextToSpeech(const aText: string);
| Name | Type | Description |
|---|---|---|
aText | const string | Text to be converted to speech. Interpreted as plain text or SSML depending on AmazonOptions.TextType. |
Builds a Polly synthesize request using the values configured in AmazonOptions, signs it with the AWS credentials, writes the returned audio to AmazonOptions.FileName and - if an AudioPlayer is assigned - plays the file. The generated file is deleted after playback so that each call starts from a clean state.
oTTS.AmazonOptions.VoiceId := 'Joanna';
oTTS.AmazonOptions.FileName := 'out.mp3';
oTTS.TextToSpeech('The quick brown fox jumps over the lazy dog.');