|
| Speech using in asp.net! |
 |
Fri, 14 Mar 2008 06:19:03 +080 |
Hi£¬ I using speech sdk like this, on page begin request, the speech create wav
file and lame convert to mp3. but page can not response end. page will stop at
connect timeout error.
public void ProcessRequest(HttpContext context) {
SpeechSynthesizer ss = new SpeechSynthesizer();
SpeechAudioFormatInfo WavFromat = new SpeechAudioFormatInfo(16000,
AudioBitsPerSample.Sixteen, AudioChannel.Mono);
ss.SelectVoice("VW Wang");
ss.SetOutputToWaveFile(@"d:\a\aaaaa.wav", WavFromat);
//ss.SpeakCompleted += new
EventHandler<SpeakCompletedEventArgs>(Synthesizer_SpeakCompleted);
ss.Speak("ÕâÊǺϳÉÓïÒô²¥±¨µÄÄÚÈÝ£º" +
context.Request.Form["speechtext"]);
mp3Encode(@"d:\a\aaaaa.wav", @"d:\a\aaaaa.mp3");
} |
| Post Reply
|
| Re: Speech using in asp.net! |
 |
Fri, 14 Mar 2008 06:56:35 +080 |
obviously .SelectVoice and .Speak is asynchronous. this is the reason why
the page can not reponse.
"weijie.zhang" <zhangweijie@gmail.com> дÈëÏûÏ¢
news:uCjfAhVhIHA.3788@TK2MSFTNGP04.phx.gbl...
Hi£¬ I using speech sdk like this, on page begin request, the speech create
wav file and lame convert to mp3. but page can not response end. page will
stop at connect timeout error.
public void ProcessRequest(HttpContext context) {
SpeechSynthesizer ss = new SpeechSynthesizer();
SpeechAudioFormatInfo WavFromat = new SpeechAudioFormatInfo(16000,
AudioBitsPerSample.Sixteen, AudioChannel.Mono);
ss.SelectVoice("VW Wang");
ss.SetOutputToWaveFile(@"d:\a\aaaaa.wav", WavFromat);
//ss.SpeakCompleted += new
EventHandler<SpeakCompletedEventArgs>(Synthesizer_SpeakCompleted);
ss.Speak("ÕâÊǺϳÉÓïÒô²¥±¨µÄÄÚÈÝ£º" +
context.Request.Form["speechtext"]);
mp3Encode(@"d:\a\aaaaa.wav", @"d:\a\aaaaa.mp3");
}
|
| Post Reply
|
| Re: Speech using in asp.net! |
 |
Fri, 14 Mar 2008 16:05:45 +080 |
I have resolved it!
"weijie.zhang" <zhangweijie@gmail.com> дÈëÏûÏ¢
news:uCjfAhVhIHA.3788@TK2MSFTNGP04.phx.gbl...
Hi£¬ I using speech sdk like this, on page begin request, the speech create
wav file and lame convert to mp3. but page can not response end. page will
stop at connect timeout error.
public void ProcessRequest(HttpContext context) {
SpeechSynthesizer ss = new SpeechSynthesizer();
SpeechAudioFormatInfo WavFromat = new SpeechAudioFormatInfo(16000,
AudioBitsPerSample.Sixteen, AudioChannel.Mono);
ss.SelectVoice("VW Wang");
ss.SetOutputToWaveFile(@"d:\a\aaaaa.wav", WavFromat);
//ss.SpeakCompleted += new
EventHandler<SpeakCompletedEventArgs>(Synthesizer_SpeakCompleted);
ss.Speak("ÕâÊǺϳÉÓïÒô²¥±¨µÄÄÚÈÝ£º" +
context.Request.Form["speechtext"]);
mp3Encode(@"d:\a\aaaaa.wav", @"d:\a\aaaaa.mp3");
}
|
| Post Reply
|
|
|
|
|
|
|
|
|
|