DefaultAudioTrackProvider


@UnstableApi
class DefaultAudioTrackProvider : DefaultAudioSink.AudioTrackProvider


The default provider for AudioTrack instances.

Subclasses of this provider can customize the AudioTrack.Builder in customizeAudioTrackBuilder if required.

Summary

Public constructors

Public functions

AudioTrack!
getAudioTrack(
    audioTrackConfig: AudioSink.AudioTrackConfig!,
    audioAttributes: AudioAttributes!,
    audioSessionId: Int
)

Returns a new AudioTrack for the given parameters.

Protected functions

AudioTrack.Builder!

Optionally customize AudioTrack.Builder with other parameters.

Public constructors

DefaultAudioTrackProvider

DefaultAudioTrackProvider()

Public functions

getAudioTrack

fun getAudioTrack(
    audioTrackConfig: AudioSink.AudioTrackConfig!,
    audioAttributes: AudioAttributes!,
    audioSessionId: Int
): AudioTrack!

Returns a new AudioTrack for the given parameters.

Protected functions

customizeAudioTrackBuilder

@RequiresApi(value = 23)
@CanIgnoreReturnValue
protected fun customizeAudioTrackBuilder(audioTrackBuilder: AudioTrack.Builder!): AudioTrack.Builder!

Optionally customize AudioTrack.Builder with other parameters.

Note that this method is only called on API 23 and above.

Parameters
audioTrackBuilder: AudioTrack.Builder!

The AudioTrack.Builder on which to set the attributes.

Returns
AudioTrack.Builder!

The same AudioTrack.Builder instance provided.