AudioDeviceInput

class VideoKit.Inputs.AudioDeviceInput : IDisposable

The AudioDeviceInput is a lightweight recorder input for recording microphone audio from an AudioDevice.

Creating the Audio Device Input

/// <summary>
/// Create an audio device input.
/// </summary>
/// <param name="recorder">Media recorder to receive audio frames.</param>
/// <param name="clock">Clock for generating timestamps.</param>
/// <param name="audioDevice">Audio device to record from.</param>
AudioDeviceInput (IMediaRecorder recorder, IClock clock, AudioDevice audioDevice);

The audio device input is created with an IMediaRecorder which receives audio sample buffers from an AudioDevice. This constructor accepts an IClock which is used to generate audio timestamps. There is an overload which does not accept a clock, for recorders which do not rely on timestamps:

/// <summary>
/// Create an audio device input.
/// </summary>
/// <param name="recorder">Media recorder to receive audio frames.</param>
/// <param name="audioDevice">Audio device to record from.</param>
AudioDeviceInput (IMediaRecorder recorder, AudioDevice audioDevice);

The audio device input immediately calls StartRunning on the audio device, so make sure that the audio device is not running.

Disposing the Recorder Input

/// <summary>
/// Stop recorder input and release resources.
/// </summary>
void Dispose ();

This method stops streaming audio from the audio device and releases any resources.

Last updated