GotSpeech.NET

The online community for Microsoft Speech Server developers
Welcome to GotSpeech.NET Sign in | Join | Help
in Search
CBrekeke Software

How do you switch the TTS engine to Spanish.

Last post 07-27-2009, 3:31 PM by Azhuri. 14 replies.
Sort Posts: Previous Next
  •  06-26-2008, 12:48 PM 6060

    How do you switch the TTS engine to Spanish.

    I must be missing something as I haven't been able to get this to work even though the Spanish Language Pack is installed.

    private const string _defaultLanguage = "es-US";

    Thread.CurrentThread.CurrentCulture = new CultureInfo(_defaultLanguage);

    this.TelephonySession.CurrentUICulture = new CultureInfo(_defaultLanguage);

    Thread.CurrentThread.CurrentCulture = new CultureInfo(_defaultLanguage);

    this.TelephonySession.CurrentUICulture = new CultureInfo(_defaultLanguage);

    foreach (VoiceInfo info in this.TelephonySession.Synthesizer.InstalledVoices)

    {

    //if (info.Gender == VoiceGender.Female && CultureInfo.Equals(this.TelephonySession.CurrentUICulture, info.Culture))

    {

    this.TelephonySession.Synthesizer.DefaultVoice = info;

    }

    }

     

    I've tried this code (from ConcertSansFrontiere) both with and without the for loop code. I've tried in the debugger and with a SIP phone call on the server. If I leave the loop in but comment out the if so that this.TelephonySession.Synthesizer.DefaultVoice = info fires each time through the loop I end up with a male voice but it sounds like it is an English voice saying "halo mundo";

    I've used "Hello World" and "hola mundo" for my prompt text. But it is always played with the English voice.

    Anyone got this to work?

     


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-26-2008, 1:24 PM 6061 in reply to 6060

    Re: How do you switch the TTS engine to Spanish.

    this.TelephonySession.CurrentUICulture = new CultureInfo("ES-US"); is what I use and it works for me

  •  06-26-2008, 1:51 PM 6062 in reply to 6060

    Re: How do you switch the TTS engine to Spanish.

    Are you sure that you're not passing in any SSML with English specified as the language?
    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  06-26-2008, 2:06 PM 6063 in reply to 6062

    Re: How do you switch the TTS engine to Spanish.

    I used you code and it still uses the English voice.

    I have a statement that has it's text (in the Property Builder) set to "Hello World". Then I have a code block then another statement with the text set to "hola mundo".

    Everything plays with the default English female voice.

    Is there a way to make sure the Spanish voice installed correctly?


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-26-2008, 5:53 PM 6065 in reply to 6063

    Re: How do you switch the TTS engine to Spanish.

    What is the language of the SSML passed to the engine? You should be able to see it via the debugging window.

    See if the Spanish engine is in the list retrieved via Synthesizer.InstalledVoices.


    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  06-27-2008, 8:43 AM 6070 in reply to 6065

    Re: How do you switch the TTS engine to Spanish.

    OK. Explain this.

    1. It works if I set the Spanish Engine in the turnstarting event of the statement. If I try to set it globally using a code block the SSML language is en-US.

    Code Block:

    SYS : <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"

    TurmStarting:

    SYS : <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="es-US"

     

    2. I set the TelephonySession.CurrentUICulture to "es-US" but there is no installed voice for that culture. How does it work when the installed voice has "es-MX" for its culture?

    ? this.TelephonySession.Synthesizer.InstalledVoices
    Count = 4
        [0]: "'ScanSoft Javier Telecom'  'es-MX'  'Male'  'Adult' "
        [1]: "'ScanSoft Jill Telecom'  'en-US'  'Female'  'Adult' "
        [2]: "'ScanSoft Paulina Telecom'  'es-MX'  'Female'  'Adult' "
        [3]: "'ScanSoft Tom Telecom'  'en-US'  'Male'  'Adult' "


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-27-2008, 8:50 AM 6071 in reply to 6070

    Re: How do you switch the TTS engine to Spanish.

    It also works if set to "es-MX".

    So I guess something is translating.


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-27-2008, 10:01 AM 6076 in reply to 6070

    Re: How do you switch the TTS engine to Spanish.

    1. That doesn't make sense if it's being set correctly.

    2. I think internally we treal es-MX as es-US so that's why you're seeing it work.


    --
    How To Ask a Question: http://support.microsoft.com/kb/555375
    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  06-27-2008, 11:00 AM 6078 in reply to 6076

    Re: How do you switch the TTS engine to Spanish.

    I downloaded the correct language pack.

    Is this a bug in the language pack that it uses "es-MX" instead of the standard "es-US"?


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-27-2008, 11:14 AM 6079 in reply to 6078

    Re: How do you switch the TTS engine to Spanish.

    No it is not a bug.  When Speech Server was in development there was no es-US - so internally it is mapped to es-MX.  es-US was introduced for the first time after Vista.
    Greg Winters [MS]
    Unified Communications Group

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
  •  06-27-2008, 2:26 PM 6081 in reply to 6079

    Re: How do you switch the TTS engine to Spanish.

    Thanks Greg.

     

    I can get it to work and once set it works for all of the remaining prompts. The only issue is that it has to be set in a turnstarting event. Is that normal behavior? It can't be set in a code activity?


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-28-2008, 9:59 AM 6090 in reply to 6081

    Re: How do you switch the TTS engine to Spanish.

    marshallharrison:

    Thanks Greg.

     

    I can get it to work and once set it works for all of the remaining prompts. The only issue is that it has to be set in a turnstarting event. Is that normal behavior? It can't be set in a code activity?

     

    I do mine in a code activity

    Thread.CurrentThread.CurrentCulture = new CultureInfo("es-US");
    this.TelephonySession.CurrentUICulture = new CultureInfo("es-US");
    Helper.SetTTSVoice(TelephonySession);

  •  06-28-2008, 10:02 PM 6092 in reply to 6090

    Re: How do you switch the TTS engine to Spanish.

    davros:
    marshallharrison:

    Thanks Greg.

     

    I can get it to work and once set it works for all of the remaining prompts. The only issue is that it has to be set in a turnstarting event. Is that normal behavior? It can't be set in a code activity?

     

    I do mine in a code activity

    Thread.CurrentThread.CurrentCulture = new CultureInfo("es-US");
    this.TelephonySession.CurrentUICulture = new CultureInfo("es-US");
    Helper.SetTTSVoice(TelephonySession);

     

    I tried setting the current thread's culture but same results.

    All you really need is - this.TelephonySession.CurrentUICulture = new CultureInfo("ES-US");

    The problem I'm having is that it needs to be done in a turnstarting event. Set it once and it works for all of the QAs,


    Marshall Harrison
    MVP, Office Communications Server
    GotSpeech Consulting LLC
    Phone: (904) 222-8880
    the gotspeech guy
  •  06-30-2009, 1:23 PM 9114 in reply to 6060

    Re: How do you switch the TTS engine to Spanish.

    New to the forum, with what must seem a very basic question. So far, I'm doing all my development in VXML. How do I change the TTS voice to Spanish-female?

    I can set the the language to "es-US" in the VXML header, and the default voice is male. Trying to set the voice gender in the VXML code <voice gender = "female"/> throws an error. Same happens if I leave the language en-US and try to code for a male voice.

    Latest language packs are installed for es-US.

    Somewhere, even for VXML, there must be an application properties section where this can be set.

    Happy to experiment to find the solution, but maybe one of you has already been down this path.

    Thanks!

    Larry Rushing 

     

     

    Filed under: , ,
  •  07-27-2009, 3:31 PM 9218 in reply to 9114

    Re: How do you switch the TTS engine to Spanish.

    You can try this it works for me.

    public VoiceInfo _defaultVoice;

    //*********************************************

                    // TTS VOICE

                    // 0 - Javier - male spanish

                    // 1 - Jill - female english

                    // 2 - Paulina - female spanish

                    // 3 - Tom - male english

                    //*********************************************

                    this.TelephonySession.Synthesizer.DefaultVoice = this.TelephonySession.Synthesizer.InstalledVoices[2];

                    // Note the original VoiceInfo.

                    _defaultVoice = this.Synthesizer.DefaultVoice;

    // set spanish TTS

                    Thread.CurrentThread.CurrentCulture = new CultureInfo("es-MX");

                    this.main.TelephonySession.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

     

    askSpanishMenu.MainPrompt.AppendText("Para repetir estas opciones oprima la estrella. Para regresar a las opciones anteriores oprima el numeral.");

    Then to change back to english as default, if you are using mixed language apps.

    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

    this.main.TelephonySession.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

     

     

View as RSS news feed in XML