标签:class ext 文件 window name for new res file text os
1.生成声音文件
DotNetSpeech.SpeechVoiceSpeakFlags SSF =
DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync;
DotNetSpeech.SpVoice vo
= new SpVoiceClass();
System.Windows.Forms.SaveFileDialog SFD = new
System.Windows.Forms.SaveFileDialog();
SFD.Filter = "All files
(*.*)|*.*|wav files (*.wav)|*.wav";
SFD.Title = "Save to a wav file";
SFD.FilterIndex = 2;
SFD.RestoreDirectory = true;
if(SFD.ShowDialog()==System.Windows.Forms.DialogResult.OK)
{
DotNetSpeech.SpeechStreamFileMode SSFM =
DotNetSpeech.SpeechStreamFileMode.SSFMCreateForWrite;
DotNetSpeech.SpFileStream SFS = new DotNetSpeech.SpFileStreamClass();
SFS.Open(SFD.FileName,SSFM,false);
vo.AudioOutputStream = SFS;
vo.Speak(this.textBox1.Text,SSF);
vo.WaitUntilDone(System.Threading.Timeout.Infinite);
SFS.Close();
2.朗读
DotNetSpeech.SpeechVoiceSpeakFlags SSF =
DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync;
DotNetSpeech.SpVoice vo
= new SpVoiceClass();
vo.Speak(this.textBox1.Text,SSF);
标签:class ext 文件 window name for new res file text os
原文地址:http://www.cnblogs.com/ChineseMoonGod/p/3700762.html