本文介绍了语音暂停和停止问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我在Web应用程序中使用SAPI(5.1)时遇到了Microsoft Speech Object Library问题(asp.net4.0
和c#)
当我单击继续播放时.
当我尝试停止或暂停时,它不会停止或暂停.
它会一直播放到文本结束为止.
我该如何停止和暂停.
Hi all i have getting problem Microsoft Speech Object Library when using SAPI(5.1) in web application(asp.net4.0
and c#)
when i click play its playing continuely.
when i try to stop or pause its not stopped or pause.
it will play until text is over.
how can i stop and pause.
推荐答案
SpVoice voice = new SpVoice ();
voice.Speak ("An example of SpVoice.",SpeechVoiceSpeakFlags.SVSFlagsAsync);
下面的代码是我的项目之一的一部分...
我使用 System.Speech dll的 SpeechSynthesizer 类.
创建一个实例,如..
Below code is a part of one of my project...
I use SpeechSynthesizer class of System.Speech dll.
Create an instance like..
SpeechSynthesizer synthesis=new SpeechSynthesizer();
然后用于语音转换..
Then for speech conversion i use..
synthesis.SpeakAsync(richTextBox1.Text);//speaks the text
要停止讲话,我使用..
To stop speech i use..
synthesis.Dispose();//stops the synthesizer hence the speech!
这篇关于语音暂停和停止问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!