【问题标题】:Can I use voices other than Microsoft voices with System.Speech.Synthesis我可以在 System.Speech.Synthesis 中使用 Microsoft 语音以外的语音吗
【发布时间】:2018-12-11 14:23:56
【问题描述】:

这就是我必须制作一个简单的文本到语音转换应用程序。这工作正常。

    static void Main(string[] args)
    {
        SpeechSynthesizer ss = new SpeechSynthesizer();
        string file = @"C:\test.wav";
        ss.SetOutputToWaveFile(file, new SpeechAudioFormatInfo(16000, AudioBitsPerSample.Sixteen, AudioChannel.Mono));

        PromptBuilder pb = new PromptBuilder();

        pb.StartVoice("Microsoft David Desktop");
        pb.AppendSsmlMarkup("Hello world");
        pb.EndVoice();

        ss.Speak(pb);

        Console.ReadLine();
    }

现在我的问题是,我是否可以使用 Microsoft 语音以外的语音来大声朗读文本。像 L&H Michael 或 Michelle 一样,声音符合 SAPI。

我尝试使用 L&H Michael 或 Michelle 进行此操作,但该应用程序不使用这些语音,而是使用默认的 Microsoft 语音。

【问题讨论】:

    标签: c# asp.net .net text-to-speech


    【解决方案1】:

    我主要使用 SAPI SDK 11 或 System.Speech,但您是否尝试过使用 .GetInstalledVoices 来确保您已经安装了预期的内容,然后使用 .SelectVoice 进行设置。以下是 .GetInstalledVoices 的示例:https://msdn.microsoft.com/en-us/library/system.speech.synthesis.voiceinfo(v=vs.110).aspx 和堆栈上的此示例:how I can change the voice synthesizer gender and age in C#?。如果您想要特定的声音,请使用 .SelectVoice 而不是 .SelectVoiceByHints:

    synthesizer.SelectVoice("Microsoft Server Speech Text to Speech Voice (en-US, Helen)");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-24
      相关资源
      最近更新 更多