public static void SpeakWithDelay( this ISpeechController speechController, string text, double delay, PlayDevices playDevice = PlayDevices.Both, VoicePalettes voicePalette = VoicePalettes.Default, bool isSync = false, float?volume = null) { if (delay == 0d) { speechController.Speak(text, playDevice, isSync, volume); return; } var timer = new Timer(new TimerCallback((state) => { speechController.Speak(text, playDevice, isSync); (state as Timer).Dispose(); })); timer.Change( TimeSpan.FromSeconds(delay), TimeSpan.Zero); }
public void StartUp() { _moduleController.SetBotChatlog("Intializing..."); _speechController.Speak("Intializing"); engine.RecognizeAsync(RecognizeMode.Multiple); engine.SpeechRecognized += Engine_speechRecognized; }
public bool IsListening(Query query) { switch (query.Intent) { case "start listening": _moduleController.SetBotChatlog("Starting Mic"); _speechController.Speak("Starting Mic"); IS_LISTENING = true; break; case "stop listening": _moduleController.SetBotChatlog("Stopping Mic"); _speechController.Speak("Stopping Mic"); IS_LISTENING = false; break; } return(IS_LISTENING); }
public static void SpeakWithDelay( this ISpeechController speechController, string text, int delay) { if (delay == 0) { speechController.Speak(text); return; } var timer = new Timer(new TimerCallback((state) => { speechController.Speak(text); (state as Timer).Dispose(); })); timer.Change( delay * 1000, 0); }
public static void SpeakWithDelay( this ISpeechController speechController, string text, int delay, PlayDevices playDevice = PlayDevices.Both, bool isSync = false) { if (delay == 0) { speechController.Speak(text, playDevice, isSync); return; } var timer = new Timer(new TimerCallback((state) => { speechController.Speak(text, playDevice, isSync); (state as Timer).Dispose(); })); timer.Change( delay * 1000, 0); }
/// <summary> /// TTSに話してもらう /// </summary> /// <param name="text">読上げるテキスト</param> public override void Speak(string text) { instance.Speak(text); }