win7TTS修复,使用C#SpeechSynthesizer 类

win7TTS修复,使用C#SpeechSynthesizer 类



问题背景

  • 环境
    win7(貌似是阉割版,朗读女安装之后只有联网才有声音)
  • 代码
    C#下的SpeechSynthesizer类
// 参考网址
// https://msdn.microsoft.com/zh-cn/library/system.speech.synthesis.speechsynthesizer.aspx
// 记得引用System.Speech,这是一个用于演示的控制台程序
using System;
using System.Speech.Synthesis;

namespace SampleSynthesis
{
  class Program
  {  
    static void Main(string[] args)
    {

      // Initialize a new instance of the SpeechSynthesizer.
      SpeechSynthesizer synth = new SpeechSynthesizer();

      // Configure the audio output. 
      synth.SetOutputToDefaultAudioDevice();

      // Speak a string.
      synth.Speak("This example demonstrates a basic use of Speech Synthesizer");

      Console.WriteLine();
      Console.WriteLine("Press any key to exit...");
      Console.ReadKey();
    }
  }
}
  • VS目标平台最好修改为 X86

解决方案

1. 先去下载Speech SDK 5.1

默认的安装路径是 C:\Windows\System32\Speech
下载链接
下载演示
下载完成后尝试一下,我是直接失败报错
报错异常

2. 超复杂解决方案

在此感谢静远的博客
其他参考资料:
参考一
参考二

  1. TTSrepair.exe,该安装程序安装时会在安装程序所在文件夹生成两个文件,手动删除即可;
  2. 根据不同的操作系统版本下载“SpeechPlatformRuntime(x64).msi”或“SpeechPlatformRuntime(x86).msi”安装;
  3. MSSpeech_TTS_zh-CN_HuiHui.msi
  4. voice.reg 覆盖注册表,该操作实际上就是使用上面第二篇博文中的“修改注册表”方法;

再次拜谢,推荐大家去看原博主的博客上面附上的文件下载地址

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值