public IEnumerator Start() { yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone)); var path = Application.dataPath; switch (Application.platform) { case RuntimePlatform.WindowsPlayer: path += "/StreamingAssets/"; break; case RuntimePlatform.WindowsEditor: path += "/StreamingAssets/"; break; case RuntimePlatform.IPhonePlayer: path += "/Raw/"; break; default: path += "/StreamingAssets/"; break; } path += "grammar-kit/grammar/mic.jconf"; Julius.ResultReceived += OnResultReceived; Julius.Begin(path); }
void OnDestroy() { Julius.Finish(); }
IEnumerator Start() { yield return(Application.RequestUserAuthorization(UserAuthorization.Microphone)); var path = Application.dataPath; switch (Application.platform) { case RuntimePlatform.WindowsEditor: path += "/StreamingAssets/"; break; case RuntimePlatform.WindowsPlayer: path += "/StreamingAssets/"; break; case RuntimePlatform.IPhonePlayer: path += "/Raw/"; break; } path += "dictation-kit-v4.4/run-win-gmm.jconf"; // path += "dictation-kit-v4.4/run-win-dnn.jconf"; Julius.ResultReceived += OnResultReceived; Julius.Begin(path); this.recogText.text = ""; this.messageText.text = ""; this.wStatusText.text = EMOTION_LABELS["neutral"]; this.wStatusText.color = EMOTION_COLORS["neutral"]; this.wValueText.text = "0%"; this.fStatusText.text = EMOTION_LABELS["neutral"]; this.fStatusText.color = EMOTION_COLORS["neutral"]; this.fValueText.text = "0%"; this.vStatusText.text = EMOTION_LABELS["neutral"]; this.vStatusText.color = EMOTION_COLORS["neutral"]; this.vValueText.text = "0%"; if (targetPlayer == null) { targetPlayer = this.GetComponent(typeof(EmotePlayer)) as EmotePlayer; } if (targetAudio == null) { targetAudio = this.GetComponent(typeof(AudioSource)) as AudioSource; } string[] angry = { "まったくですね。\n腹が立ちますよね。プンプン!", "angry_00", "sample_怒00" }; string[] disgust = { "うわぁ~!\n嫌ですね~吐き気がします!", "disgust_00", "sample_哀00" }; string[] fear = { "キャー!!恐ろしい!\n怖すぎます!!", "fear_00", "sample_驚00" }; string[] happy = { "良かったですね!\nその調子でいきましょう!", "happy_00", "sample_喜00" }; string[] neutral = { "他に何か言いたいことはありませんか?", "neutral_00", "背伸び" }; string[] sad = { "悲しいですね…\n私も泣きたくなります…", "sad_00", "sample_哀01" }; string[] surprise = { "ワァー!マジですか!\n本当にびっくりですね!", "surprise_00", "sample_驚01" }; this.emotionSentences = new Dictionary <string, string[]>() { { "angry", angry }, { "disgust", disgust }, { "fear", fear }, { "happy", happy }, { "neutral", neutral }, { "sad", sad }, { "surprise", surprise } }; this.StartWordRecogProcess(); this._mainContext = SynchronizationContext.Current; }