/// <summary>/// Create an audio recording input from a scene's AudioListener./// </summary>/// <paramname="recorder">Media recorder to receive committed frames.</param>/// <paramname="clock">Clock for generating timestamps.</param>/// <paramname="listener">Audio listener for the current scene.</param>AudioInput (IMediaRecorder recorder, IClock clock, AudioListener listener);
The audio input is created with a recorder to receive frames, along with a recording clock to generate timestamps. There is a corresponding constructor which does not accept a clock, for recorders that do not use audio timestamps:
/// <summary>/// Create an audio recording input from a scene's AudioListener./// </summary>/// <paramname="recorder">Media recorder to receive audio frames.</param>/// <paramname="listener">Audio listener for the current scene.</param>AudioInput (IMediaRecorder recorder, AudioListener listener);
With an Audio Source
/// <summary>/// Create an audio recording input from an AudioSource./// </summary>/// <paramname="recorder">Media recorder to receive committed frames.</param>/// <paramname="clock">Clock for generating timestamps.</param>/// <paramname="audioSource">Audio source to record.</param>/// <paramname="mute">Optional. Mute audio source while recording so that it is not heard in scene.</param>AudioInput (IMediaRecorder recorder, IClock clock, AudioSource source,bool mute =false);
The audio input is created with a recorder to receive frames, along with a recording clock to generate timestamps. The audio source can optionally be muted once audio has been sent to the recorder, using the mute flag. There is a corresponding constructor which does not accept a clock, for recorders that do not use audio timestamps:
/// <summary>/// Create an audio recording input from an AudioSource./// </summary>/// <paramname="recorder">Media recorder to receive audio frames.</param>/// <paramname="source">Audio source to record.</param>/// <paramname="mute">Optional. Mute audio source while recording so that it is not heard in scene.</param>AudioInput (IMediaRecorder recorder, AudioSource source,bool mute =false);
When recording from an AudioSource, make sure that both Bypass Effects and Bypass Listener Effects are disabled in the editor. If any is enabled, no audio will be recorded.
Disposing the Input
/// <summary>/// Stop recorder input and release resources./// </summary>voidDispose ();
When you choose to stop recording, simply dispose the recorder input. You will typically do this before calling FinishWriting on the recorder.