编程错误
Imports SpeechLib
Public Class Form1
Public vox = CreateObject("sapi.spvoice")
Private Sub cmdSpeak_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSpeak.Click
Dim t As String = "Hello , This is a Text"
Say(t)
End Sub
Public Sub Say(ByVal text As String)
vox.Speak(text,SpeechVoiceSpeakFlags.SVSFlagsAsync)
End Sub
Private Sub cmdPause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPause.Click
vox.pause()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
vox.AlertBoundary = SVEPhoneme
End Sub
End Class
我收到错误
未声明名称“SVEPhoneme”。
我如何以及在哪里申报?
Imports SpeechLib
Public Class Form1
Public vox = CreateObject("sapi.spvoice")
Private Sub cmdSpeak_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSpeak.Click
Dim t As String = "Hello , This is a Text"
Say(t)
End Sub
Public Sub Say(ByVal text As String)
vox.Speak(text,SpeechVoiceSpeakFlags.SVSFlagsAsync)
End Sub
Private Sub cmdPause_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPause.Click
vox.pause()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
vox.AlertBoundary = SVEPhoneme
End Sub
End Class
I am getting an error
Name 'SVEPhoneme' is not declared.
How and where do I declare it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它是 SpeechVoiceEvents.SVEPhoneme
如果您提前绑定此代码,这一切都会容易得多:
或者更好的是,使用 sapi、System.Speech 程序集的 .NET 包装器。
It is SpeechVoiceEvents.SVEPhoneme
This is all a lot easier if you make this code early bound:
Or better yet, use the .NET wrapper for the sapi, System.Speech assembly.
SVEPhoneme 代表 Phoneme 事件,当引擎在说话时完成一个音素时就会发生该事件。
尝试将 SVEPhoneme 设置为整数 64。
http:/ /msdn.microsoft.com/en-us/library/ms720886(v=vs.85).asp
SVEPhoneme represents the Phoneme event, which occurs when the engine completes a phoneme while speaking.
Try setting SVEPhoneme to be the integer 64.
http://msdn.microsoft.com/en-us/library/ms720886(v=vs.85).asp