/// <summary> /// Prepares and starts a stream with /// CurrentMic as input. This method starts a coroutine: /// when mic input goes live, callback will be fired. /// </summary> public void StartMicrophone(ReadyToRecordHandler callback = null) { if (IsActive) { return; } if (Microphones.Length == 0) { throw new GATException("No microphone found. Check available mics with GATMicrophone.Microphone before calling PrepareToRecord. "); } StartMicrophone(Microphones[0], callback); }
/// <summary> /// Prepares and starts a stream with /// mic input. This method starts a coroutine: /// when mic input goes live, callback will be fired. /// </summary> public void StartMicrophone(GATMicInfo micInfo, ReadyToRecordHandler callback = null) { if (IsActive) { return; } CurrentMic = micInfo; if (CurrentMic.SupportsRate(GATInfo.OutputSampleRate) == false) { throw new GATException("The current microphone does not support output sample rate of " + GATInfo.OutputSampleRate); } _onReadyToRecord = callback; StartCoroutine(InitMicrophonedRoutine()); }
/// <summary> /// Prepares and starts a stream with /// CurrentMic as input. This method starts a coroutine: /// when mic input goes live, callback will be fired. /// </summary> public void StartMicrophone( ReadyToRecordHandler callback = null ) { if( IsActive ) return; if( Microphones.Length == 0 ) { throw new GATException( "No microphone found. Check available mics with GATMicrophone.Microphone before calling PrepareToRecord. " ); } StartMicrophone( Microphones[ 0 ], callback ); }
/// <summary> /// Prepares and starts a stream with /// mic input. This method starts a coroutine: /// when mic input goes live, callback will be fired. /// </summary> public void StartMicrophone( GATMicInfo micInfo, ReadyToRecordHandler callback = null ) { if( IsActive ) return; CurrentMic = micInfo; if( CurrentMic.SupportsRate( GATInfo.OutputSampleRate ) == false ) { throw new GATException( "The current microphone does not support output sample rate of " + GATInfo.OutputSampleRate ); } _onReadyToRecord = callback; StartCoroutine( InitMicrophonedRoutine() ); }