Example #1
0
        public Task SpeechAsync(string text, string language = null)
        {
            CrossLocale?locale = null;

            if (language != null)
            {
                locale = synthesizer.GetInstalledLanguages().FirstOrDefault(l => l.Language.StartsWith(language));
                locale = locale.Value.Language != null ? locale : null;
            }

            synthesizer.Speak(text, crossLocale: locale);
            return(Task.FromResult <object>(null));
        }