コード例 #1
0
        public static void DisableVoiceCommand(Constants.Commands.VoiceCommandsEnum command)
        {
            bool disabled = false;

            if (command == Constants.Commands.VoiceCommandsEnum.BeginRoomTexture)
            {
                keywords.Remove(Constants.Commands.Keyword_BeginRoomTexturing);
                disabled = true;
            }
            else if (command == Constants.Commands.VoiceCommandsEnum.EndRoomTexture)
            {
                keywords.Remove(Constants.Commands.Keyword_EndRoomTexturing);
                disabled = true;
            }

            if (disabled)
            {
                RefreshKeywordRecognizer();
            }

            if (keywords.Count == 0)
            {
                keywordRecognizer.OnPhraseRecognized -= KeywordRecognizer_OnPhraseRecognized;
            }
        }
コード例 #2
0
        public static void EnableVoiceCommand(Constants.Commands.VoiceCommandsEnum command)
        {
            bool enabled = false;

            if (command == Constants.Commands.VoiceCommandsEnum.BeginRoomTexture)
            {
                // Command: Begin texture capture protocol
                // (i.e. start up photocapture process)
                keywords.Add(Constants.Commands.Keyword_BeginRoomTexturing, () =>
                {
                    TextureCapture.BeginCapture();
                });

                enabled = true;
            }
            else if (command == Constants.Commands.VoiceCommandsEnum.RoomScreenshot)
            {
                // Command: Take texture screenshot
                keywords.Add(Constants.Commands.Keyword_RoomScreenshot, () =>
                {
                    TextureCapture.Capture();
                });
            }
            else if (command == Constants.Commands.VoiceCommandsEnum.EndRoomTexture)
            {
                // Command: End texture capture protocol and clean up
                keywords.Add(Constants.Commands.Keyword_EndRoomTexturing, () =>
                {
                    TextureCapture.EndCapture();
                });

                enabled = true;
            }

            if (enabled)
            {
                RefreshKeywordRecognizer();
            }
        }