AudioAttributes


class AudioAttributes


Attributes for audio playback, which configure the underlying platform android.media.AudioTrack.

To set the audio attributes, create an instance using the Builder and either pass it to the player or send a message of type Renderer#MSG_SET_AUDIO_ATTRIBUTES to the audio renderers.

This class is based on android.media.AudioAttributes, but can be used on all supported API versions.

Summary

Nested types

This class is deprecated.

Use android.media.AudioAttributes.

Builder for AudioAttributes.

Constants

const AudioAttributes!

The default audio attributes, where the content type is AUDIO_CONTENT_TYPE_UNKNOWN, usage is USAGE_MEDIA, capture policy is ALLOW_CAPTURE_BY_ALL and no flags are set.

Public functions

Boolean
equals(obj: Any?)
java-static AudioAttributes!

Restores a AudioAttributes from a Bundle.

java-static AudioAttributes!

Creates a new instance from the provided android.media.AudioAttributes.

AudioAttributes.AudioAttributesV21!

This function is deprecated.

Use getPlatformAudioAttributes

Int

Returns the C.StreamType corresponding to these audio attributes.

Int
Bundle!

Constants

DEFAULT

const val DEFAULTAudioAttributes!

The default audio attributes, where the content type is AUDIO_CONTENT_TYPE_UNKNOWN, usage is USAGE_MEDIA, capture policy is ALLOW_CAPTURE_BY_ALL and no flags are set.

Public functions

equals

fun equals(obj: Any?): Boolean

fromBundle

@UnstableApi
java-static fun fromBundle(bundle: Bundle!): AudioAttributes!

Restores a AudioAttributes from a Bundle.

fromPlatformAudioAttributes

java-static fun fromPlatformAudioAttributes(audioAttributes: AudioAttributes!): AudioAttributes!

Creates a new instance from the provided android.media.AudioAttributes.

getAudioAttributesV21

fun getAudioAttributesV21(): AudioAttributes.AudioAttributesV21!

getStreamType

@UnstableApi
@C.StreamType
fun getStreamType(): Int

Returns the C.StreamType corresponding to these audio attributes.

hashCode

fun hashCode(): Int

toBundle

@UnstableApi
fun toBundle(): Bundle!

Public properties

flags

@C.AudioFlags
val flagsInt

The C.AudioFlags.

isContentSpatialized

@UnstableApi
val isContentSpatializedBoolean

Whether the content is spatialized.

platformAudioAttributes

val platformAudioAttributesAudioAttributes?

usage

@C.AudioUsage
val usageInt

The C.AudioUsage.