コード例 #1
0
 public static void LogReceived(string message)
 {
     Debug.Log("[Native]:" + message);
     VoiceCommandBase.onRecognized(message);
     VoiceCommandBase.setRecognized(true);
     VoiceCommandBase.recognized = message;
 }
コード例 #2
0
    private void Recognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args)
    {
        string word = args.text;

        VoiceCommandBase.onRecognized(word);
        VoiceCommandBase.setRecognized(true);
        VoiceCommandBase.recognized = word;
    }
コード例 #3
0
 public async Task <string> Listen(string[] commands)
 {
     activeCommands = commands;
     recognizer.StartListening(appendMetaCommands(commands));
     while (!VoiceCommandBase.isRecognized())
     {
         await Task.Delay(100);
     }
     recognizer.PauseListening();
     VoiceCommandBase.setRecognized(false);
     return(VoiceCommandBase.recognized);
 }
コード例 #4
0
 public SpeechIn(VoiceCommandBase.OnRecognized onRecognized, string[] commands)
 {
     if (Application.platform == RuntimePlatform.OSXEditor ||
         Application.platform == RuntimePlatform.OSXPlayer)
     {
         recognizer = new MacOSSpeechIn(onRecognized, commands);
     }
     else if (Application.platform == RuntimePlatform.WindowsEditor ||
              Application.platform == RuntimePlatform.WindowsPlayer)
     {
         recognizer = new WindowsSpeechIn(onRecognized, commands);
     }
 }