Beispiel #1
0
 public static void StartRecording(AudioListener audioListener, Format format, SampleBufferCallback sampleBufferCallback)
 {
     if (IsRecording)
     {
         Debug.LogError("NatMic Error: Cannot start recording because NatMic is recording");
         return;
     }
     if (!audioListener)
     {
         Debug.LogError("NatMic Error: Cannot start recording because audio source is null");
         return;
     }
     if (sampleBufferCallback == null)
     {
         Debug.LogError("NatMic Error: Cannot start recording with null callback");
         return;
     }
     audioMixer   = new AudioMixer(sampleBufferCallback);
     audioUtility = AudioUtility.Create(audioListener.gameObject, audioMixer.OnUnitySampleBuffer);
     Implementation.StartRecording(Format.DefaultForMixing, audioMixer.OnMicrophoneSampleBuffer);
 }