c# 调用using System.Speech.Synthesis语音发音无声音

.Net技术 码拜 8年前 (2016-03-10) 3179次浏览
本人做了个程序语音朗读功能,在本电脑上可以发音,可在别的电脑上不能发音,有的恩能够发音,可什么也听不清。请大神帮忙解决。
源代码: SpeechSynthesizer speaker = new SpeechSynthesizer();
speaker.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 2,            System.Globalization.CultureInfo.CurrentCulture);
speaker.Rate = -2;
speaker.Volume = 100;
strBoBao = “你好吗?”;
speaker.SpeakAsync(strBoBao);
解决方案

20

      SpeechSynthesizer synth = new SpeechSynthesizer();
      // Configure the audio output. 
      synth.SetOutputToDefaultAudioDevice();
      // Speak a string.
      synth.Speak("每天回帖即可获得10分可用分");

这个是调用系统默认的语音引擎来播放声音。你可以试下。

20

貌似是语音包的问题,看看别的电脑装没装,或程序有没有打包进去。
http://www.cnblogs.com/daytoday/archive/2013/02/17/2914124.html

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明c# 调用using System.Speech.Synthesis语音发音无声音
喜欢 (0)
[1034331897@qq.com]
分享 (0)