VideoKit
Search…
⌃K

VideoKitAudioManager

class NatML.VideoKit.VideoKitAudioManager : MonoBehaviour
This components manages audio streaming from an AudioDevice in a scene. The component can be added to any game object in the scene.

Configuring the Manager

The manager exposes options for specifying the audio format that will be requested when the AudioDevice is streamed.

Specifying the Sample Rate

/// <summary>
/// Audio sample rate.
/// </summary>
SampleRate sampleRate { get; set; } = SampleRate.MatchUnity;
INCOMPLETE.
/// <summary>
/// Audio sample rate.
/// </summary>
enum SampleRate : int {
/// <summary>
/// Match Unity's audio DSP sample rate.
/// </summary>
MatchUnity = 0,
/// <summary>
/// 8KHz.
/// </summary>
_8000 = 8000,
/// <summary>
/// 16KHz.
/// </summary>
_160000 = 16000,
/// <summary>
/// 22.05KHz.
/// </summary>
_22050 = 22050,
/// <summary>
/// 24KHz.
/// </summary>
_24000 = 24000,
/// <summary>
/// 44.1KHz.
/// </summary>
_44100 = 44100,
/// <summary>
/// 48KHz.
/// </summary>
_48000 = 48000,
}

Specifying the Channel Count

/// <summary>
/// Audio channel count.
/// </summary>
ChannelCount channelCount { get; set; } = ChannelCount.MatchUnity;
INCOMPLETE.
/// <summary>
/// Audio channel count.
/// </summary>
enum ChannelCount : int {
/// <summary>
/// Match Unity's audio DSP channel count.
/// </summary>
MatchUnity = 0,
/// <summary>
/// Mono audio.
/// </summary>
Mono = 1,
/// <summary>
/// Stereo audio.
/// </summary>
Stereo = 2,
}

Requesting Echo Cancellation

/// <summary>
/// Request echo cancellation if the device supports it.
/// </summary>
bool echoCancellation { get; set; }
INCOMPLETE.

Specifying the Audio Device

/// <summary>
/// Get ot set the audio device used to record.
/// </summary>
AudioDevice audioDevice { get; set; }
INCOMPLETE.

Checking the Streaming State

/// <summary>
/// Whether the audio device is running.
/// </summary>
bool running { get; }
INCOMPLETE.

Streaming Audio

/// <summary>
/// Start streaming audio.
/// </summary>
void StartRunning ();
INCOMPLETE.

Stopping the Stream

/// <summary>
/// Stop streaming audio.
/// </summary>
void StopRunning ();
INCOMPLETE.

Handling Sample Buffers

/// <summary>
/// Event raised when a new sample buffer is available.
/// </summary>
UnityEvent<SampleBuffer> OnSampleBuffer { get; set; }
INCOMPLETE.