Exemplo n.º 1
0
 /// <summary>
 ///  stops the recording.
 /// </summary>
 void StopRecording()
 {
     isRecording = false;
     if (useUnityMic)
     {
         Microphone.End(null);  //Stop the audio recording  
     }
     else
     {
         OutputPath = MicStream.MicStopRecording();
         Debug.Log("Saved audio recording to " + OutputPath + ", " + SaveFileName);
         CheckForErrorOnCall(MicStream.MicStopStream());
         //Debug.Log("Recorded " + audioBuffer.Length + " audio data entries.");
         //goAudioSource.clip = AudioClip.Create("Recording", audioBuffer.Length, _numChannels, AudioSettings.outputSampleRate, false);
         //goAudioSource.clip.SetData(audioBuffer, 0);
         CheckForErrorOnCall(MicStream.MicDestroy());
     }
     Debug.Log("Stopped audio recording.");
     WEKITSpeechManager.Instance.ContinueRecognizer();
     Debug.Log("Listening to voice commands again.");
     changeColor(currentColor);
 }
 private void OnDestroy()
 {
     CheckForErrorOnCall(MicStream.MicDestroy());
 }
Exemplo n.º 3
0
 private void OnDestroy()
 {
     MicStream.MicDestroy();
 }