如何处理 SAPI 引擎中的暂停事件
How to Handle Pause Event in SAPI Engine
我目前实现了 SAPI 语音,效果很好。我想知道当应用程序调用 ISpVoice->Pause 时如何处理引擎中的 Pause 事件。
据我所知,ISpVoice::Pause
完全在 SAPI 层中实现,不进行任何引擎调用。
我正在尝试准确了解您的最终目标,但我想我会尝试回答这个问题。
对于语音,暂停根据MSDN执行以下操作:
ISpVoice::Pause 在最近的警报边界暂停语音并关闭输出设备,允许访问来自其他语音的未决发言请求。
假设您已经使用 SPF_AYSNC 通话,您可能还必须设置事件兴趣和警报边界,如 here
所示
示例显示处理书签警报边界的位置
'Create a Normal Priority voice - male
Set objHIM = New SpVoice
Set objHIM.Voice = objHIM.GetVoices("gender=male").Item(0)
objHER.Speak "the priority of this voice is S V P alert"
objHIM.Speak "the priority of this voice is S V P normal"
objHIM.EventInterests = SVEBookmark 'Receive bookmark events only
objHIM.AlertBoundary = SVEPhoneme 'Let alert voices interrupt words
'Normal voice speaks text which generates events.
strSpeak = "This is text that contains bookmarks " _
& "for the purpose of generating events."
objHIM.Speak strSpeak, SVSFIsXML + SVSFlagsAsync
我目前实现了 SAPI 语音,效果很好。我想知道当应用程序调用 ISpVoice->Pause 时如何处理引擎中的 Pause 事件。
据我所知,ISpVoice::Pause
完全在 SAPI 层中实现,不进行任何引擎调用。
我正在尝试准确了解您的最终目标,但我想我会尝试回答这个问题。
对于语音,暂停根据MSDN执行以下操作:
ISpVoice::Pause 在最近的警报边界暂停语音并关闭输出设备,允许访问来自其他语音的未决发言请求。
假设您已经使用 SPF_AYSNC 通话,您可能还必须设置事件兴趣和警报边界,如 here
所示示例显示处理书签警报边界的位置
'Create a Normal Priority voice - male
Set objHIM = New SpVoice
Set objHIM.Voice = objHIM.GetVoices("gender=male").Item(0)
objHER.Speak "the priority of this voice is S V P alert"
objHIM.Speak "the priority of this voice is S V P normal"
objHIM.EventInterests = SVEBookmark 'Receive bookmark events only
objHIM.AlertBoundary = SVEPhoneme 'Let alert voices interrupt words
'Normal voice speaks text which generates events.
strSpeak = "This is text that contains bookmarks " _
& "for the purpose of generating events."
objHIM.Speak strSpeak, SVSFIsXML + SVSFlagsAsync