public void SelectVoice(string voiceId) { OnecoreVoiceInfo voice = ( from vinfo in GetVoices() where vinfo.Id.Equals(voiceId) select vinfo).Single(); Voice = voice; }
public IEnumerable <OnecoreVoiceInfo> GetVoices() { List <OnecoreVoiceInfo> voiceList = new List <OnecoreVoiceInfo>(); foreach (VoiceInformation vc in SpeechSynthesizer.AllVoices) { OnecoreVoiceInfo voice = new OnecoreVoiceInfo(vc.DisplayName, vc.Description, vc.Id, vc.Language); voiceList.Add(voice); } voiceList.Sort(); return(voiceList); }