语音合成问题 [英] problem in speech.synthesis
本文介绍了语音合成问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是Asp.Net的初学者,我使用System.Speech.Synthesis在我的一个Web表单中将文本转换为语音.起初,我遇到一个使"Async = True"出错.之后,我将文本转换为语音.但是问题是Web表单永远不会停止加载阶段.这是我使用的代码
I''m just a beginner in Asp.Net, I used System.Speech.Synthesis for converting text to voice in one of my webform. At first i got an error to make the ''Async=True''. After that I''m getting the text be converted to voice. But the problem is the web form never stops loading stage.. Here is the code I used
LinkButton lnkplay = sender as LinkButton;
GridViewRow gvrowpaly = lnkplay.NamingContainer as GridViewRow;
string filePathplay = ReviewGrid.DataKeys[gvrowpaly.RowIndex].Value.ToString();
filePathplay = Server.MapPath("~/images/" + filePathplay);
string strplay = ReadFile(filePathplay);
txt_hide.Text = strplay;
int count = 0;
SpeechSynthesizer spechObject = new SpeechSynthesizer();
spechObject.Rate = -4;
spechObject.Volume = 100;
Prompt prmt = new Prompt(txt_hide.Text);
spechObject.SpeakAsync(prmt);
spechObject.SetOutputToWaveFile(File.Exists(Server.MapPath("~/audio/test.wav")) ? Server.MapPath("~/audio/test(" + (count + 1).ToString() + ").wav") : Server.MapPath("~/audio/test.wav"));
spechObject.SetOutputToNull();
//spechObject.SpeakAsyncCancel(new Prompt("prmt"));
// spechObject.SetOutputToDefaultAudioDevice();
spechObject.SpeakAsyncCancel(prmt);
请给我一个正确的解决方案,我已经尝试了很多...
kindly give me a correc t solution i have tried a lot ...
推荐答案
请参阅这些..
https://sites.google.com/site/saneparakrishna/convert- text-into-speech-in-asp-net [ ^ ]
http://stackoverflow.com/questions/7674482/speechsynthesizer-in-asp-net-异步错误 [ ^ ]
See these..
https://sites.google.com/site/saneparakrishna/convert-text-into-speech-in-asp-net[^]
http://stackoverflow.com/questions/7674482/speechsynthesizer-in-asp-net-async-error[^]
这篇关于语音合成问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文