AudioOutputProvider.FormatConfig.Builder


public final class AudioOutputProvider.FormatConfig.Builder


Builder for FormatConfig instances.

Summary

Public constructors

Builder(Format format)

Creates a new builder.

Public methods

AudioOutputProvider.FormatConfig

Builds the FormatConfig.

AudioOutputProvider.FormatConfig.Builder

Sets the AudioAttributes.

AudioOutputProvider.FormatConfig.Builder

Sets the audio session ID.

AudioOutputProvider.FormatConfig.Builder
@CanIgnoreReturnValue
setEnableHighResolutionPcmOutput(
    boolean enableHighResolutionPcmOutput
)

Sets whether to enable high resolution PCM output with more than 16 bits.

AudioOutputProvider.FormatConfig.Builder
@CanIgnoreReturnValue
setEnableOffload(boolean enableOffload)

Sets whether the audio output should enable offload.

AudioOutputProvider.FormatConfig.Builder
@CanIgnoreReturnValue
setEnablePlaybackParameters(boolean enablePlaybackParameters)

Sets whether to control the playback parameters using the AudioOutput implementation.

AudioOutputProvider.FormatConfig.Builder
@CanIgnoreReturnValue
setEnableTunneling(boolean enableTunneling)

Sets whether tunneling is enabled.

AudioOutputProvider.FormatConfig.Builder

Sets the preferred buffer size in bytes, or LENGTH_UNSET if no preference is specified.

AudioOutputProvider.FormatConfig.Builder

Sets the preferred AudioDeviceInfo.

AudioOutputProvider.FormatConfig.Builder

Sets the virtual device ID, or INDEX_UNSET if not specified.

Public constructors

Builder

public Builder(Format format)

Creates a new builder.

Public methods

build

public AudioOutputProvider.FormatConfig build()

Builds the FormatConfig.

setAudioSessionId

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setAudioSessionId(int audioSessionId)

Sets the audio session ID. The default value is AUDIO_SESSION_ID_UNSET.

This parameter should not generally affect the outcome of getFormatSupport.

setEnableHighResolutionPcmOutput

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableHighResolutionPcmOutput(
    boolean enableHighResolutionPcmOutput
)

Sets whether to enable high resolution PCM output with more than 16 bits.

setEnableOffload

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableOffload(boolean enableOffload)

Sets whether the audio output should enable offload.

This parameter should not generally affect the outcome of getFormatSupport.

setEnablePlaybackParameters

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnablePlaybackParameters(boolean enablePlaybackParameters)

Sets whether to control the playback parameters using the AudioOutput implementation.

This parameter should not generally affect the outcome of getFormatSupport.

setEnableTunneling

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableTunneling(boolean enableTunneling)

Sets whether tunneling is enabled.

This parameter should not generally affect the outcome of getFormatSupport.

setPreferredBufferSize

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setPreferredBufferSize(int preferredBufferSize)

Sets the preferred buffer size in bytes, or LENGTH_UNSET if no preference is specified.

This parameter should not generally affect the outcome of getFormatSupport.

setVirtualDeviceId

@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setVirtualDeviceId(int virtualDeviceId)

Sets the virtual device ID, or INDEX_UNSET if not specified. The default value is INDEX_UNSET.

This parameter should not generally affect the outcome of getFormatSupport.