pascalabcnet/bin/Lib/Speech.pas
Mikhalkovich Stanislav e603b1fd6d Mikhalkovich в Copyright
Заготовка для школьного плагина образцов кода
2019-07-28 23:53:15 +03:00

32 lines
623 B
ObjectPascal

// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
{$reference System.Speech.dll}
unit Speech;
interface
procedure Speak(s: string);
procedure SpeakAsync(s: string);
implementation
uses System.Speech.Synthesis;
var ss: SpeechSynthesizer;
procedure Speak(s: string);
begin
ss.Speak(s)
end;
procedure SpeakAsync(s: string);
begin
ss.SpeakAsync(s)
end;
begin
ss := new SpeechSynthesizer;
var voices := ss.GetInstalledVoices;
ss.SelectVoice(voices[0].VoiceInfo.Name)
end.