예제 #1
0
        public void SelectVoice(string voiceId)
        {
            OnecoreVoiceInfo voice = (
                from vinfo in GetVoices()
                where vinfo.Id.Equals(voiceId)
                select vinfo).Single();

            Voice = voice;
        }
예제 #2
0
        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);
        }