通过import of Component导入封装TTS引擎,
然后选择:
最后调用:
MyVoce := CoSpVoice.Create; MyVoce.Pause;//暂停 MyVoce.Status; fVoce.Resume; if fVoce.Status.RunningState = SRSEDone then MyVoce.Speak(Memo1.Text, SVSFlagsAsync); //注意:状态判断,否者连续点击会一遍遍的重复. // 其次采用异步模式(SVSFlagsAsync)你懂得
================================================
直接调用方法:
uses Comobj var myvoice: OLEVariant; begin myvoice := CreateOLEObject('SAPI.SpVoice'); myvoice.Speak('请选择仓库', 0); end