Exemplo n.º 1
0
    public void SpeakUsingAvailableLocaleOnDevice()
    {
        //on this example we will use spain locale
        TTSLocaleCountry ttsLocaleCountry = TTSLocaleCountry.SPAIN;

        //check if available
        bool isLanguageAvailanble = textToSpeechPlugin.CheckLocale(ttsLocaleCountry);

        if (isLanguageAvailanble)
        {
            string countryISO2Alpha = textToSpeechPlugin.GetCountryISO2Alpha(ttsLocaleCountry);

            //set spain language
            textToSpeechPlugin.SetLocaleByCountry(countryISO2Alpha);
            Debug.Log(TAG + "locale set," + ttsLocaleCountry.ToString() + "locale is available");

            SpeakOut();
        }
        else
        {
            Debug.Log(TAG + "locale not set," + ttsLocaleCountry.ToString() + "locale is  notavailable");
        }
    }