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
sourceAudioSourceThe AudioSource to capture from.
channelsintThe number of channels to capture.
sourceTypeRtcAudioSourceTypeThe type of audio source.
Methods
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposingbool
~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
Remarks
This event is not guaranteed to be called on the main thread.