AudioOutputProvider


@UnstableApi
public 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

default static final int

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

default static final int

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

default static final int

The provider does not support the format.

Public methods

abstract void

Adds a Listener.

abstract AudioOutput

Returns an AudioOutput for the given config.

abstract AudioOutputProvider.FormatSupport

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

abstract AudioOutputProvider.OutputConfig

Returns the OutputConfig for the given format.

abstract void

Releases resources held by the provider.

abstract void

Removes a Listener.

abstract void
setClock(Clock clock)

Sets the Clock to use in the provider.

Constants

FORMAT_SUPPORTED_DIRECTLY

default static final int FORMAT_SUPPORTED_DIRECTLY = 2

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

FORMAT_SUPPORTED_WITH_TRANSCODING

default static final int FORMAT_SUPPORTED_WITH_TRANSCODING = 1

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

default static final int FORMAT_UNSUPPORTED = 0

The provider does not support the format.

Public methods

addListener

abstract void addListener(AudioOutputProvider.Listener listener)

Adds a Listener.

Parameters
AudioOutputProvider.Listener listener

The listener to add.

getFormatSupport

abstract AudioOutputProvider.FormatSupport getFormatSupport(AudioOutputProvider.FormatConfig formatConfig)

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

Parameters
AudioOutputProvider.FormatConfig formatConfig

The FormatConfig.

Returns
AudioOutputProvider.FormatSupport

The FormatSupport for this config.

release

abstract void release()

Releases resources held by the provider.

removeListener

abstract void removeListener(AudioOutputProvider.Listener listener)

Removes a Listener.

Parameters
AudioOutputProvider.Listener listener

The listener to remove.

setClock

abstract void setClock(Clock clock)

Sets the Clock to use in the provider.