TsgcTextToSpeechSystem › Methods › TextToSpeech
Speaks the supplied text using the Windows SAPI voice engine (SpVoice) via OLE automation.
procedure TextToSpeech(const aText: string);
| Name | Type | Description |
|---|---|---|
aText | const string | Text to be spoken through the default Windows SAPI voice. |
Creates a SAPI.SpVoice OLE object and calls its Speak method to output the text through the system's default voice and audio device. No API keys or network access are required. OnStart is fired before playback begins and OnStop when it ends. Available on Windows only.
oTTS := TsgcTextToSpeech_System.Create(nil);
try
oTTS.TextToSpeech('Hello from Windows SAPI.');
finally
oTTS.Free;
end;