AudioTrackAudioOutputProvider


@UnstableApi
class AudioTrackAudioOutputProvider : AudioOutputProvider


A default implementation of AudioOutputProvider.

Summary

Nested types

A builder to create AudioTrackAudioOutputProvider instances.

Public functions

Unit

Adds a Listener.

AudioOutput!

Returns an AudioOutput for the given config.

AudioOutputProvider.FormatSupport!

Returns the level of support that this provider has for a given FormatConfig.

AudioOutputProvider.OutputConfig!

Returns the OutputConfig for the given format.

Unit

Releases resources held by the provider.

Unit

Removes a Listener.

Unit
setClock(clock: Clock!)

Sets the Clock to use in the provider.

Public properties

java-static Boolean

Whether to throw an AudioTrackAudioOutput.InvalidAudioTrackTimestampException when a spurious timestamp is reported from getTimestamp.

Inherited Constants

From androidx.media3.exoplayer.audio.AudioOutputProvider
const Int

The provider supports the format directly, without the need for internal transcoding.

const Int

The provider supports the format, but needs to transcode it internally to do so.

const Int

The provider does not support the format.

Public functions

addListener

fun addListener(listener: AudioOutputProvider.Listener!): Unit

Adds a Listener.

Parameters
listener: AudioOutputProvider.Listener!

The listener to add.

getFormatSupport

fun getFormatSupport(formatConfig: AudioOutputProvider.FormatConfig!): AudioOutputProvider.FormatSupport!

Returns the level of support that this provider has for a given FormatConfig.

Parameters
formatConfig: AudioOutputProvider.FormatConfig!

The FormatConfig.

Returns
AudioOutputProvider.FormatSupport!

The FormatSupport for this config.

release

fun release(): Unit

Releases resources held by the provider.

removeListener

fun removeListener(listener: AudioOutputProvider.Listener!): Unit

Removes a Listener.

Parameters
listener: AudioOutputProvider.Listener!

The listener to remove.

setClock

fun setClock(clock: Clock!): Unit

Sets the Clock to use in the provider.

Public properties

failOnSpuriousAudioTimestamp

java-static val failOnSpuriousAudioTimestampBoolean

Whether to throw an AudioTrackAudioOutput.InvalidAudioTrackTimestampException when a spurious timestamp is reported from getTimestamp.

The flag must be set before creating a player. Should be set to true for testing and debugging purposes only.