diff --git a/MixItUp.WPF/Services/WindowsSpeechService.cs b/MixItUp.WPF/Services/WindowsSpeechService.cs index a3923e894..3c71d70b1 100644 --- a/MixItUp.WPF/Services/WindowsSpeechService.cs +++ b/MixItUp.WPF/Services/WindowsSpeechService.cs @@ -30,14 +30,21 @@ public IEnumerable GetVoices() { List voices = new List(); - SpeechSynthesizer synthesizer = new SpeechSynthesizer(); - foreach (InstalledVoice voice in synthesizer.GetInstalledVoices()) + try { - if (voice.Enabled) + SpeechSynthesizer synthesizer = new SpeechSynthesizer(); + foreach (InstalledVoice voice in synthesizer.GetInstalledVoices()) { - voices.Add(new TextToSpeechVoice(voice.VoiceInfo.Name)); + if (voice.Enabled) + { + voices.Add(new TextToSpeechVoice(voice.VoiceInfo.Name)); + } } } + catch (Exception ex) + { + Logger.Log(ex); + } return voices; }