RoboZhando/Synthesizer.cs
/// <summary>Checks if the given voice name exists and returns the appropriate full length one.</summary>
Checks if the given voice name exists and returns the appropriate full length one.
Checks if the given voice name exists and returns the appropriate full length one .
public async Task<string> GetVoiceNameAsync(string voiceName)
        {
            voiceName = voiceName.Trim();
            var voices = await synthesizer.GetVoicesAsync();
            return voices.Voices.Where(voice =>
                voice.Name.Equals(voiceName, StringComparison.InvariantCultureIgnoreCase) ||
                voice.ShortName.Equals(voiceName, StringComparison.InvariantCultureIgnoreCase)
            ).Select(voice => voice.ShortName).FirstOrDefault();
        }
public async Task < string > GetVoiceNameAsync ( string voiceName ) { voiceName = voiceName . Trim ( ) ; var voices = await synthesizer . GetVoicesAsync ( ) ; return voices . Voices . Where ( voice => voice . Name . Equals ( voiceName , StringComparison . InvariantCultureIgnoreCase ) || voice . ShortName . Equals ( voiceName , StringComparison . InvariantCultureIgnoreCase ) ) . Select ( voice => voice . ShortName ) . FirstOrDefault ( ) ; }
Checks if the given voice name exists and returns the appropriate full length one.
Checks if the given voice name exists and returns the appropriate full length one .
voiceName
string