Exemple #1
0
        /// <summary>
        /// Returns a voice object for the specified language and locale.
        /// </summary>
        /// <param name="language">A BCP 47 code specifying language and locale for a voice.</param>
        /// <returns>Returns null if no voice available for the specified language</returns>
        public static ISpeechSynthesisVoice GetVoiceForLanguage(string language)
        {
            var voiceId = TTS_iOS.GetVoiceIdentifierFromLanguageCode(language);

            return(AllAvailableVoices.FirstOrDefault(voice => voice.Identifier == voiceId));
        }