public static void Init(IHostApp app) { if (hostApp != null) { hostApp.Log(LogType.WRN, "ZoomMeetingBotSDK.Sound: Already Initialized"); return; } hostApp = app; cfg = DeserializeJson <SoundConfigurationSettings>(hostApp.GetSettingsAsJSON()); hostApp.Log(LogType.DBG, "Initializing TTS"); tts = new SpeechSynthesizer(); var voice = cfg.TTSVoice; if ((voice != null) && (voice.Length > 0)) { try { tts.SelectVoice(voice); } catch (Exception e) { hostApp.Log(LogType.ERR, "TTS failed to load voice {0}; Falling back on default; Err={1}", voice, repr(e)); } } hostApp.Log(LogType.INF, "TTS Loaded voice {0}", repr(tts.Voice.Name)); tts.SetOutputToDefaultAudioDevice(); timer = new System.Threading.Timer(TimerHandler, null, 0, 250); }
private void LoadSettings() { lock (SettingsLock) { cfg = DeserializeJson <SimpleBotConfigurationSettings>(hostApp.GetSettingsAsJSON()); ExpandDictionaryPipes(cfg.OneTimeHiSequences); ExpandDictionaryPipes(cfg.SmallTalkSequences); } }
private void LoadSettings() { lock (SettingsLock) { randomBotConfigurationSettings = DeserializeJson <RandomBotConfigurationSettings>(hostApp.GetSettingsAsJSON()); } }