public void EnqueueSound(VoicePreset preset, TextSource source, string text) { AddQueueItem(new SystemSoundQueueItem { Preset = preset, Text = text, Source = source, }); }
public static void UseVoicePreset(this SpeechSynthesizer synthesizer, VoicePreset preset) { synthesizer.Rate = preset.Rate; synthesizer.Volume = preset.Volume; try { if (synthesizer.Voice.Name != preset.VoiceName) { synthesizer.SelectVoice(preset.VoiceName); } } catch (Exception e) { PluginLog.LogError(e, "Failed to select voice {0}", preset.VoiceName); } }