TsgcTextToSpeechAmazonMethods › TextToSpeech

TextToSpeech Method

Sends the text to Amazon Polly and stores the synthesized audio in AmazonOptions.FileName.

Syntax

void __fastcall TextToSpeech(const UnicodeString aText);

Parameters

NameTypeDescription
aTextconst stringText to be converted to speech. Interpreted as plain text or SSML depending on AmazonOptions.TextType.

Remarks

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.

Example

Back to Methods