Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a new Language to SpeechSynthesizer

So I'am trying to add a new language, spesifically norwegian, to SpeechSynthesizer, but it doesn't seem to get installed.

Found this: Add another voice into .NET Speech (But here the problem is that Czech isn't supported)

I have installed the norwegian pack from here: http://www.microsoft.com/en-us/download/details.aspx?id=27224

In my code I use this to check if it is installed:

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

But it only outputs: Microsoft Zira Desktop - English (United States)

Have checked the text-to-Speech tool were this is also the only option. Have also tried to log off/log on and restart the computer.

Anyone know how to fix this?

like image 790
Moddaman Avatar asked Mar 20 '15 10:03

Moddaman


People also ask

What is system Speech?

The Windows Desktop Speech Technology software offers a basic speech recognition infrastructure that digitizes acoustical signals, and recovers words and speech elements from audio input. Applications use the System. Speech.


1 Answers

You may need to add a Speech Language to Windows 10 and set your Locale, Country, Windows display language and Speech language so they are all aligned with one of Cortana's supported locale configurations.

To confirm the settings are set correctly:

  1. Open Settings. Select Time& language, and then Region & Language.

  2. Check the Language (set as default) setting for your Windows display language. If your desired language is not available, add your desired language:

    • Click Add Language.
    • Select your desired language from the list.
    • Select the desired locale, which is the language/country combination.
    • Click on the newly selected locale and select Options.
    • Under Download language pack, click Download.
    • Under Speech, click Download.
    • After the downloads are complete (this could take several minutes), return to the Time & Language settings.
    • Click on your new language and select Set as Default.
    • NOTE: IF you changed languages, you must sign out of your account and back in for the new setting to take effect.
  3. Check the Country or region setting. Make sure the country selected corresponds with the Windows display language set in the Language setting.

  4. Return to Settings and Time & language, and then select Speech. Check the Speech language setting, and make sure it’s aligned with the previous settings.

After you have correctly done the above, your language should appear in the SpeechSynthesizer.AllVoices collection. You should then be able to assign this voice to your SpeechSynthesizer instance's Voice property:

    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

like image 51
TheGuern Avatar answered Oct 17 '22 17:10

TheGuern