62,046
社区成员
发帖
与我相关
我的任务
分享
protected void btnSend_Click(object sender, EventArgs e)
{
string strPath = Server.MapPath("/");
string strTxt = this.tbTxt.Text;
ISpeechVoice sv = new SpVoiceClass();
SpFileStream fs = new SpFileStream();
fs.Format.Type = SpeechAudioFormatType.SAFTADPCM_44kHzStereo;
fs.Open(strPath + "/1.wav", SpeechStreamFileMode.SSFMCreateForWrite, false);
sv.AudioOutputStream = fs;
ISpeechObjectTokens sps = sv.GetVoices("Language = 804", "");
sv.Voice = sps.Item(0);
sv.Speak(strTxt, SpeechVoiceSpeakFlags.SVSFDefault);
fs.Close();
}