Table of Contents

Class RtcAudioSource

Namespace
LiveKit

Capture source for a local audio track.

public abstract class RtcAudioSource : IRtcSource, IDisposable
Inheritance
RtcAudioSource
Implements
Derived
Inherited Members
Extension Methods

Constructors

RtcAudioSource(RtcAudioSourceType)

protected RtcAudioSource(RtcAudioSourceType audioSourceType)

Parameters

audioSourceType RtcAudioSourceType

RtcAudioSource(RtcAudioSourceType, uint, uint)

protected RtcAudioSource(RtcAudioSourceType audioSourceType, uint sampleRate, uint channels)

Parameters

audioSourceType RtcAudioSourceType
sampleRate uint
channels uint

Fields

_info

protected AudioSourceInfo _info

Field Value

AudioSourceInfo

Properties

Muted

public override bool Muted { get; }

Property Value

bool

SourceType

public RtcAudioSourceType SourceType { get; }

Property Value

RtcAudioSourceType

Methods

Dispose()

Disposes of the audio source, stopping it first if necessary.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

~RtcAudioSource()

protected ~RtcAudioSource()

Prepare(float)

[Obsolete("No longer used, audio sources should perform any preparation in Start() asynchronously")]
public virtual IEnumerator Prepare(float timeout = 0)

Parameters

timeout float

Returns

IEnumerator

PrepareAndStart()

[Obsolete("Use Start() instead")]
public IEnumerator PrepareAndStart()

Returns

IEnumerator

SetMute(bool)

Mutes or unmutes the audio source.

public override void SetMute(bool muted)

Parameters

muted bool

Start()

Begin capturing audio samples from the underlying source.

public virtual void Start()

Stop()

Stop capturing audio samples from the underlying source.

public virtual 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 abstract 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.