locked
Spanish text to speech on C# RRS feed

  • Question

  • Hello guys, I downloaded this to make my application speak in Spanish, but I can't figure out how to use it, can you please help me? I want to make it read a string.

    https://www.microsoft.com/en-us/download/details.aspx?id=27224

    I installed it, now what? I'm using Visual Studio Community 2015, and using Windows Forms.

    Thanks!!!

    Thursday, August 25, 2016 12:06 AM

Answers

  • Hi dh4m13l,

    Thank you for posting here.

    For your question, what is the version of your computer?

    After you installed it, you could check your installed voice using the following code.

    using System;
    using System.Speech.Synthesis;
    using System.Speech.AudioFormat;
    
    
    namespace SampleSynthesis
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                // Initialize a new instance of the SpeechSynthesizer.
                using (SpeechSynthesizer synth = new SpeechSynthesizer())
                {
    
                    // Output information about all of the installed voices. 
                    Console.WriteLine("Installed voices -");
                    foreach (InstalledVoice voice in synth.GetInstalledVoices())
                    {
                        VoiceInfo info = voice.VoiceInfo;
                        string AudioFormats = "";
                        foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats)
                        {
                            AudioFormats += String.Format("{0}\n",
                            fmt.EncodingFormat.ToString());
                        }
    
                        Console.WriteLine(" Name:          " + info.Name);
                        Console.WriteLine(" Culture:       " + info.Culture);
                        Console.WriteLine(" Age:           " + info.Age);
                        Console.WriteLine(" Gender:        " + info.Gender);
                        Console.WriteLine(" Description:   " + info.Description);
                        Console.WriteLine(" ID:            " + info.Id);
                        Console.WriteLine(" Enabled:       " + voice.Enabled);
                        if (info.SupportedAudioFormats.Count != 0)
                        {
                            Console.WriteLine(" Audio formats: " + AudioFormats);
                        }
                        else
                        {
                            Console.WriteLine(" No supported audio formats found");
                        }
    
                        string AdditionalInfo = "";
                        foreach (string key in info.AdditionalInfo.Keys)
                        {
                            AdditionalInfo += String.Format("  {0}: {1}\n", key, info.AdditionalInfo[key]);
                        }
    
                        Console.WriteLine(" Additional Info - " + AdditionalInfo);
                        Console.WriteLine();
                    }
                }
                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }
    }

    In my computer, I installed two voice.

    And you need to know that the Supported Operating System are Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista in the link you provided .

    If you meet the requirements, you could change the text to speech in the setting. Here is a simple example in win 10.

    I hope this would be helpful to you.

    If you have something else, please feel free to contact us.

    Best Regards,

    Wendy



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Friday, August 26, 2016 6:07 AM

All replies

  • Language detection and synthesis is still more the area of Langauge Scientists then Programmers. In addition to the Speech SDK you need the Spanish Langauge pack (if there is one) and hope it has TTS modules.
    Both must be installed on any computer running your programm as well.

    There rest should be in this Toutorial. It can be a bit confusing wich TTS engine they are there for, as there is more then one:
    https://msdn.microsoft.com/en-us/library/office/system.speech.synthesis.ttsengine.aspx

    And just to make it even more confusing, sicne Vista there are apparently another Speech Engine built into the OS avalible through .NET 4.0 or later.


    Remember to mark helpfull answers as helpfull and close threads by marking answers.

    Thursday, August 25, 2016 11:42 AM
  • Hi dh4m13l,

    Thank you for posting here.

    For your question, what is the version of your computer?

    After you installed it, you could check your installed voice using the following code.

    using System;
    using System.Speech.Synthesis;
    using System.Speech.AudioFormat;
    
    
    namespace SampleSynthesis
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                // Initialize a new instance of the SpeechSynthesizer.
                using (SpeechSynthesizer synth = new SpeechSynthesizer())
                {
    
                    // Output information about all of the installed voices. 
                    Console.WriteLine("Installed voices -");
                    foreach (InstalledVoice voice in synth.GetInstalledVoices())
                    {
                        VoiceInfo info = voice.VoiceInfo;
                        string AudioFormats = "";
                        foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats)
                        {
                            AudioFormats += String.Format("{0}\n",
                            fmt.EncodingFormat.ToString());
                        }
    
                        Console.WriteLine(" Name:          " + info.Name);
                        Console.WriteLine(" Culture:       " + info.Culture);
                        Console.WriteLine(" Age:           " + info.Age);
                        Console.WriteLine(" Gender:        " + info.Gender);
                        Console.WriteLine(" Description:   " + info.Description);
                        Console.WriteLine(" ID:            " + info.Id);
                        Console.WriteLine(" Enabled:       " + voice.Enabled);
                        if (info.SupportedAudioFormats.Count != 0)
                        {
                            Console.WriteLine(" Audio formats: " + AudioFormats);
                        }
                        else
                        {
                            Console.WriteLine(" No supported audio formats found");
                        }
    
                        string AdditionalInfo = "";
                        foreach (string key in info.AdditionalInfo.Keys)
                        {
                            AdditionalInfo += String.Format("  {0}: {1}\n", key, info.AdditionalInfo[key]);
                        }
    
                        Console.WriteLine(" Additional Info - " + AdditionalInfo);
                        Console.WriteLine();
                    }
                }
                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }
    }

    In my computer, I installed two voice.

    And you need to know that the Supported Operating System are Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista in the link you provided .

    If you meet the requirements, you could change the text to speech in the setting. Here is a simple example in win 10.

    I hope this would be helpful to you.

    If you have something else, please feel free to contact us.

    Best Regards,

    Wendy



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Friday, August 26, 2016 6:07 AM