TsgcTextToSpeechGoogleMethods › TextToSpeech

TextToSpeech Method

Sends the text to Google Cloud Text-To-Speech and stores the synthesized audio in GoogleOptions.FileName.

Syntax

void __fastcall TextToSpeech(const UnicodeString aText);

Parameters

NameTypeDescription
aTextconst stringText to be synthesized. Sent as the input.text field of the Google Cloud request.

Remarks

Builds a Google Cloud text:synthesize request using GoogleOptions, obtains a Bearer token through the service-account JWT defined by GoogleOptions.Settings, base64-decodes the audioContent returned by Google into GoogleOptions.FileName and - if an AudioPlayer is assigned - plays the file. The file is deleted after playback.

Example

Back to Methods