【実現したいこと】
UnityでIntel RealSense SDKを使用して音声認識させたいです。
【発生している問題】
https://qiita.com/miyumiyu/items/e01f4493ee59da3dfef1
こちらのサイトのC#スクリプトを使用させていただき、実行しました、
作成したスクリプトはInputVoice.csです。
using UnityEngine; public class VoiceInput : MonoBehaviour { private PXCMSession session; private PXCMAudioSource source; private PXCMSpeechRecognition sr; private PXCMSpeechRecognition.Handler handler; public void Start() { session = PXCMSession.CreateInstance(); source = session.CreateAudioSource(); PXCMAudioSource.DeviceInfo dinfo = null; source.QueryDeviceInfo(0, out dinfo); source.SetDevice(dinfo); Debug.Log(dinfo.name); session.CreateImpl<PXCMSpeechRecognition>(out sr); PXCMSpeechRecognition.ProfileInfo pinfo; sr.QueryProfile(out pinfo); pinfo.language = PXCMSpeechRecognition.LanguageType.LANGUAGE_JP_JAPANESE; sr.SetProfile(pinfo); handler = new PXCMSpeechRecognition.Handler(); handler.onRecognition = OnRecognition; sr.SetDictation(); sr.StartRec(source, handler); } private void OnRecognition(PXCMSpeechRecognition.RecognitionData data){ Debug.Log(data.scores[0].sentence); } void OnDisable() { if (sr != null) { sr.StopRec(); sr.Dispose(); } if (session != null) session.Dispose(); } }
しかし、喋ってもコンソールに
マイク (High Definition Audio デバイス) UnityEngine.Debug:Log(Object) VoiceInput:Start() (at Assets/Script/VoiceInput.cs:19)
としか表示されません。
使用しているパソコンにはマイクがないので、100均で購入したイヤホンマイクを使用しています。
原因がわかる方、教えていただけないでしょうか。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。