AudioOutputProvider


@UnstableApi
interface AudioOutputProvider

Known direct subclasses
AudioTrackAudioOutputProvider

A default implementation of AudioOutputProvider.

ForwardingAudioOutputProvider

A forwarding base class that delegates all calls to the provided AudioOutputProvider.


A provider for AudioOutput instances and for querying their support.

Summary

Nested types

Thrown when a failure occurs configuring the output.

Configuration for an audio format and its output preferences.

Builder for FormatConfig instances.

Level of support for an audio format by the provider.

A builder to create FormatSupport instances.

Thrown when a failure occurs initializing the output.

Listener for AudioOutputProvider events.

Configuration for an AudioOutput.

Builder for OutputConfig instances.

The level of support the provider has for a format.

Constants

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

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.

Constants

FORMAT_SUPPORTED_DIRECTLY

const val FORMAT_SUPPORTED_DIRECTLY = 2: Int

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

FORMAT_SUPPORTED_WITH_TRANSCODING

const val FORMAT_SUPPORTED_WITH_TRANSCODING = 1: Int

The provider supports the format, but needs to transcode it internally to do so. Internal transcoding may result in lower quality and higher CPU load in some cases.

FORMAT_UNSUPPORTED

const val FORMAT_UNSUPPORTED = 0: 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.