Table of Contents

Class BasicAudioSource

Namespace
LiveKit

An audio source which captures from a Unity AudioSource in the scene.

public sealed class BasicAudioSource : RtcAudioSource, IDisposable
Inheritance
BasicAudioSource
Implements
Inherited Members
Extension Methods

Constructors

BasicAudioSource(AudioSource, int, RtcAudioSourceType)

Creates a new basic audio source for the given AudioSource in the scene.

public BasicAudioSource(AudioSource source, int channels = 2, RtcAudioSourceType sourceType = RtcAudioSourceType.AudioSourceCustom)

Parameters

source AudioSource

The AudioSource to capture from.

channels int

The number of channels to capture.

sourceType RtcAudioSourceType

The type of audio source.

Methods

Dispose(bool)

protected override void Dispose(bool disposing)

Parameters

disposing bool

~BasicAudioSource()

protected ~BasicAudioSource()

Start()

Begin capturing audio samples from the underlying source.

public override void Start()

Stop()

Stop capturing audio samples from the underlying source.

public override void Stop()

Events

AudioRead

Event triggered when audio samples are captured from the underlying source. Provides the audio data, channel count, and sample rate.

public override event Action<float[], int, int> AudioRead

Event Type

Action<float[], int, int>

Remarks

This event is not guaranteed to be called on the main thread.