小编Bru*_*oBL的帖子

使用Dephi的SAPI:异步语音不起作用

以下工作完美(Delphi 7):

procedure TMainForm.SayIt(s:string); // s is the string to be spoken
var
voice: OLEVariant;
begin
  memo1.setfocus;
  voice := CreateOLEObject ('SAPI.SpVoice');
  voice.Voice := voice.GetVoices.Item(combobox1.ItemIndex); // current voice selected
  voice.volume := tbVolume.position;
  voice.rate := tbRate.position;
  voice.Speak (s, SVSFDefault);
end;
Run Code Online (Sandbox Code Playgroud)

以上工作在"同步"模式(SVSFDefault标志),但如果我在尝试以异步模式播放声音时将标志更改为SVSFlagsAsync,则不会产生声音.没有给出错误消息,但扬声器上没有播放任何内容.

问题可能是什么?我在Delphi的Imports文件夹中有SpeechLib_TLB单元.

编辑:这是在Windows XP中

谢谢,布鲁诺.

delphi sapi text-to-speech delphi-7

4
推荐指数
1
解决办法
1989
查看次数

标签 统计

delphi ×1

delphi-7 ×1

sapi ×1

text-to-speech ×1