TsgcAIOpenAIChatBot › Properties › TextToSpeech
Component used to speak the assistant reply (System, Google or Amazon TTS).
property TextToSpeech: TsgcTextToSpeech read FTextToSpeech write SetTextToSpeech;
—
Assign any descendant of TsgcTextToSpeech: TsgcTextToSpeechSystem (Windows SAPI), TsgcTextToSpeechGoogle, or TsgcTextToSpeechAmazon. The ChatBot wires up the OnStart/OnStop events automatically and, when AudioRecorder.RecorderOptions.Mode = camoAuto, restarts recording after playback ends so the user can reply. If TextToSpeech is nil the reply is emitted only via OnChatCompletion.
sgcTextToSpeech := TsgcTextToSpeechSystem.Create(Self);
sgcChatBot.TextToSpeech := sgcTextToSpeech;