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. |
class AudioAttributes.BuilderBuilder for |
Constants |
|
|---|---|
const AudioAttributes! |
The default audio attributes, where the content type is |
Public functions |
|
|---|---|
Boolean |
|
java-static AudioAttributes! |
@UnstableApiRestores a |
java-static AudioAttributes! |
fromPlatformAudioAttributes(audioAttributes: AudioAttributes!)Creates a new instance from the provided |
AudioAttributes.AudioAttributesV21! |
This function is deprecated. |
Int |
Returns the |
Int |
hashCode() |
Bundle! |
Public properties |
|
|---|---|
Int |
|
Int |
The |
Int |
The |
Boolean |
Whether haptic channels are muted. |
Boolean |
Whether the content is spatialized. |
AudioAttributes? |
|
Int |
|
Int |
The |
Constants
DEFAULT
const val DEFAULT: 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
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.
getStreamType
@UnstableApi
@C.StreamType
fun getStreamType(): Int
Returns the C.StreamType corresponding to these audio attributes.
Public properties
isContentSpatialized
@UnstableApi
val isContentSpatialized: Boolean
Whether the content is spatialized.