TsgcTextToSpeechGoogleProperties › AudioPlayer

AudioPlayer Property

Optional TsgcAudioPlayer used to play back the audio returned by Google Cloud Text-To-Speech.

Syntax

property AudioPlayer: TsgcAudioPlayer read FAudioPlayer write SetAudioPlayer;

Default Value

Remarks

Assign a TsgcAudioPlayer instance to automatically play the synthesized audio once the Google API response has been base64-decoded and written to GoogleOptions.FileName. If no player is assigned the audio is not played. The component forwards the player's start and stop notifications to OnStart and OnStop.

Example

oPlayer := TsgcAudioPlayer.Create(Self);
oTTS := TsgcTextToSpeech_Google.Create(Self);
oTTS.AudioPlayer := oPlayer;
oTTS.TextToSpeech('Playing via Google Cloud');

Back to Properties