procedure TForm1.FormCreate(Sender: TObject);
var Token:ISpeechObjectToken;
begin
FISpeech:=coSpVoice.Create;
Token:=FISpeech.GetVoices('','').Item(2);
FlatComboBox1.Items.add(Token.GetDescription(0));
end;
procedure TForm1.FlatButton1Click(Sender: TObject);
begin
FISpeech.Voice := FISpeech.GetVoices('','').Item(0);
FISpeech.Set_Rate(5);
FISpeech.Speak(FlatMemo1.Lines.Text, SVSFlagsAsync);
end;
procedure TForm1.FlatButton2Click(Sender: TObject);
begin
FISpeech.Speak('', SVSFPurgeBeforeSpeak);
end;
procedure TForm1.FlatButton3Click(Sender: TObject);
begin
if FlatButton3.caption='暂停' then
begin
FISpeech.Pause;
FlatButton3.caption:='继续';
end
Else
begin
FISpeech.Resume;
FlatButton3.caption:='暂停';
end;
end;
end.