【问题标题】:Adding a new Language to SpeechSynthesizer向 SpeechSynthesizer 添加新语言
【发布时间】:2015-03-20 10:09:53
【问题描述】:

所以我正在尝试向 SpeechSynthesizer 添加一种新语言,特别是挪威语,但它似乎没有安装。

发现这个: Add another voice into .NET Speech (但这里的问题是不支持捷克语)

我从这里安装了挪威包: http://www.microsoft.com/en-us/download/details.aspx?id=27224

在我的代码中,我使用它来检查它是否已安装:

     foreach (var voice in speaker.GetInstalledVoices())
        {
            Console.WriteLine(voice.VoiceInfo.Description);
        }

但它只输出: Microsoft Zira Desktop - 英语(美国)

已检查文本转语音工具,这也是唯一的选择。 也试过注销/登录并重启电脑。

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: c# .net speech-synthesis


    【解决方案1】:

    您可能需要向 Windows 10 添加语音语言并设置您的区域设置、国家/地区、Windows 显示语言和语音语言,以便它们都与 Cortana 支持的区域设置配置之一保持一致。

    确认设置是否正确:

    1. 打开设置。选择时间和语言,然后选择地区和语言。

    2. 检查您的 Windows 显示语言的语言(设置为默认值)设置。如果您想要的语言不可用,请添加您想要的语言:

      • 点击添加语言。
      • 从列表中选择您想要的语言。
      • 选择所需的区域设置,即语言/国家/地区组合。
      • 单击新选择的语言环境并选择选项。
      • 在下载语言包下,点击下载。
      • 在语音下,点击下载。
      • 下载完成后(这可能需要几分钟),返回时间和语言设置。
      • 点击您的新语言并选择设为默认。
      • 注意:如果您更改了语言,则必须退出帐户并重新登录才能使新设置生效。
    3. 检查国家或地区设置。确保所选国家/地区与语言设置中设置的 Windows 显示语言相对应。

    4. 返回设置和时间和语言,然后选择语音。检查语音语言设置,并确保它与之前的设置一致。

    正确完成上述操作后,您的语言应该会出现在 SpeechSynthesizer.AllVoices 集合中。然后,您应该能够将此语音分配给 SpeechSynthesizer 实例的 Voice 属性:

        private async void SpeakText(MediaElement audioPlayer, string TTS)
        {
            SpeechSynthesizer ttssynthesizer = new SpeechSynthesizer();
    
            //Set the Voice/Speaker to Spanish
            using (var speaker = new SpeechSynthesizer())
            {
                speaker.Voice = (SpeechSynthesizer.AllVoices.First(x => x.Gender == VoiceGender.Female && x.Language.Contains("ES")) );
                ttssynthesizer.Voice = speaker.Voice;
            }
    
            SpeechSynthesisStream ttsStream = await ttssynthesizer.SynthesizeTextToStreamAsync(TTS);
    
            audioPlayer.SetSource(ttsStream, "");
        }
    

    http://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/speech-language-in-windows-10-home/3f04bc02-9953-40b1-951c-c1d262fc3f63?auth=1

    【讨论】:

      猜你喜欢
      • 2016-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-26
      相关资源
      最近更新 更多