음성을 선택 할 수 있는데 별반 차이가 없네요.
procedure TfrmStudyLaw2.FormCreate(Sender: TObject);
var
FileName: String;
SOTokenVoice: ISpeechObjectToken;
SOTokenVoices: ISpeechObjectTokens;
....
begin
// speech
SpVoice1.EventInterests:= SVEAllEvents;
SOTokenVoices:= SpVoice1.GetVoices('','');
for i := 0 to SOTokenVoices.Count-1 do begin
SOTokenVoice:= SOTokenVoices.Item(i);
ComboBoxVoices.Items.AddObject(SOTokenVoice.GetDescription(0), TObject(SOTokenVoice));
SOTokenVoice._AddRef;
end;
if ComboBoxVoices.Items.Count > 0 then begin
ComboBoxVoices.ItemIndex := ComboBoxVoices.Items.IndexOf(SpVoice1.Voice.GetDescription(0))
end;
end.
procedure TfrmStudyLaw2.Button5Click(Sender: TObject);
const iSpeechFlags: integer = SVSFlagsAsync + SVSFPurgeBeforeSpeak + SVSFIsXML;
var
idx, jdx, kdx: Integer;
begin
SpVoice1.Rate:= tbRate.Position;
for idx := 0 to SpinEdit1.Value-1 do begin
if CBStopSpeechA.Checked then Break;
for jdx := 0 to ListBox1.Items.Count-1 do begin
if CBStopSpeechA.Checked then Break;
if ListBox1.Checked[jdx] then
for kdx := 0 to SpinEdit2.Value-1 do begin
if CBStopSpeech1.Checked then Break;
SpVoice1.Speak(ListBox1.Items[jdx],iSpeechFlags);
repeat
Application.ProcessMessages;
until (SpVoice1.WaitUntilDone(10));
end;
CBStopSpeech1.Checked:= False;
end;
end;
CBStopSpeechA.Checked:= False;
end;