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

A direct wrapper around 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.

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.

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.

usage

@C.AudioUsage
val usageInt

The C.AudioUsage.