TsgcTextToSpeechGoogle › Properties › AudioPlayer
Optional TsgcAudioPlayer used to play back the audio returned by Google Cloud Text-To-Speech.
property AudioPlayer: TsgcAudioPlayer read FAudioPlayer write SetAudioPlayer;
—
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.
oPlayer := TsgcAudioPlayer.Create(Self);
oTTS := TsgcTextToSpeech_Google.Create(Self);
oTTS.AudioPlayer := oPlayer;
oTTS.TextToSpeech('Playing via Google Cloud');