コード例 #1
0
ファイル: Sound.cs プロジェクト: apresence/ZoomMeetingBotSDK
        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);
        }
コード例 #2
0
        public void Init(ChatBotInitParam param)
        {
            if (hostApp != null)
            {
                hostApp.Log(LogType.WRN, $"SimpleBot.Start(): Already initialized");
                return;
            }

            hostApp = param.hostApp;
            hostApp.SettingsChanged += new EventHandler(SettingsChanged);

            LoadSettings();
        }
コード例 #3
0
        public void Init(ChatBotInitParam param)
        {
            if (hostApp != null)
            {
                hostApp.Log(LogType.WRN, "chatBot already initialized");
            }

            hostApp = param.hostApp;
        }