LocalAudioTrack

class LocalAudioTrack @AssistedInject constructor(@Assisted name: String, @Assisted mediaTrack: AudioTrack, @Assisted options: LocalAudioTrackOptions, audioProcessingController: AudioProcessingController, @Named(value = "dispatcher_default") dispatcher: CoroutineDispatcher, @Named(value = "local_audio_record_samples_dispatcher") audioRecordSamplesDispatcher: AudioRecordSamplesDispatcher, @Named(value = "local_audio_record_samples_dispatcher") audioBufferCallbackDispatcher: AudioBufferCallbackDispatcher) : AudioTrack

Represents a local audio track (generally using the microphone as input).

This class should not be constructed directly, but rather through LocalParticipant.createAudioTrack.

Constructors

Link copied to clipboard
@AssistedInject
constructor(@Assisted name: String, @Assisted mediaTrack: AudioTrack, @Assisted options: LocalAudioTrackOptions, audioProcessingController: AudioProcessingController, @Named(value = "dispatcher_default") dispatcher: CoroutineDispatcher, @Named(value = "local_audio_record_samples_dispatcher") audioRecordSamplesDispatcher: AudioRecordSamplesDispatcher, @Named(value = "local_audio_record_samples_dispatcher") audioBufferCallbackDispatcher: AudioBufferCallbackDispatcher)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@AssistedFactory
interface Factory

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@FlowObservable
@get:FlowObservable
val features: <Error class: unknown class>

Changes can be observed by using io.livekit.android.util.flow

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val rtcTrack: AudioTrack

The underlying WebRTC audio track.

Link copied to clipboard
var sid: String?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addSink(sink: AudioTrackSink)

Note: This function relies on us setting JavaAudioDeviceModule.Builder.setSamplesReadyCallback. If you provide your own AudioDeviceModule, or set your own callback, your sink will not receive any audio data.

Link copied to clipboard
open override fun dispose()

Disposes the track. LiveKit will generally take care of disposing tracks for you.

Link copied to clipboard
suspend fun getRTCStats(): RTCStatsReport?

Return the RTCStatsReport for this track, or null if none is available.

fun getRTCStats(callback: RTCStatsCollectorCallback)

Calls the callback with the RTCStatsReport for this track, or null if none is available.

Link copied to clipboard
open override fun removeSink(sink: AudioTrackSink)

Removes a previously added sink.

Link copied to clipboard

Use this method to mix in custom audio.

Link copied to clipboard
open fun start()

Starts the track.

Link copied to clipboard
open fun stop()

Stops the track.