Beispiel #1
0
        public static string VoiceCaptureGetString(VoiceCaptureType capturetype)
        {
            IsRecording = true;                                                         //////////////////////////////////////////////////

            ForcedShortCaptureCtrl(true);                                               //보이스 트리거 끔
            AudIOData audIOData = audioIO.PlayMp3SoundAndRecordSound("ClovaSound.mp3"); //커맨드 캡쳐 시작

            if (audIOData.error == true)
            {
                return(null);
            }

            Console.WriteLine("OnVoiceRecorded!");

            List <string> KeyWordList;

            if (capturetype == VoiceCaptureType.SearchYN)
            {
                KeyWordList = Commandmanager.YNCommandKeyWordList;
            }
            else
            {
                KeyWordList = Commandmanager.CommandKeyWordList;
            }

            string speechV = speechRS.GoogleSpeechRecognition(audIOData.AudioStreamByte, KeyWordList);

            Console.WriteLine(speechV);

            IsRecording = false;//////////////////////////////////////////////////

            return(speechV);
        }
Beispiel #2
0
        public static void StartVoiceCapture(VoiceCaptureType capturetype)
        {
            IsRecording = true;                                                         /////////////////////////////////////////////////

            ForcedShortCaptureCtrl(true);                                               //보이스 트리거 끔
            AudIOData audIOData = audioIO.PlayMp3SoundAndRecordSound("ClovaSound.mp3"); //커맨드 캡쳐 시작

            if (audIOData.error == true)
            {
                Console.WriteLine("에러가 발생하였습니다");
                return;
            }

            Console.WriteLine("OnVoiceRecorded!");

            List <string> KeyWordList = new List <string>();

            if (capturetype == VoiceCaptureType.SearchYN)
            {
                KeyWordList = Commandmanager.YNCommandKeyWordList;
            }
            else if (capturetype == VoiceCaptureType.DefaultCapture)
            {
                KeyWordList = Commandmanager.CommandKeyWordList;
            }

            string speechV = speechRS.GoogleSpeechRecognition(audIOData.AudioStreamByte, KeyWordList);

            Console.WriteLine(speechV);

            IsRecording = false;/////////////////////////////////////////////////

            Commandmanager.AnalyzeCmdString(speechV, capturetype);
        }