Audio core client types
- TOC
Available types
AudioContentType
AudioUsageType
AudioStatus
AudioVolumeType
AudioVolumeFlags
AudioRole
AudioDevice
AudioTelephonyMode
AudioEvent
AudioSampleRate
AudioChannelMask
AudioSampleFormat
AudioFlags
AudioConfig
AudioAttributes
AudioDeviceInfo
AudioSource
AudioSystemSound
SampleLayout
SinkFormatsSelectionPolicy
StreamDuckingPolicy
AudioPlaybackEvent
DuckingMode
AudioFocusStatus
AudioFocusAttributes
AudioFocusChange
AudioContentType
Description
Each value determines a different content type for the playback stream. The content type helps the audio system understand what kind of content is being played, which affects how it should be handled in terms of audio focus and routing.
Possible Values
export enum AudioContentType {
CONTENT_TYPE_NONE = 0,
CONTENT_TYPE_SPEECH = 1,
CONTENT_TYPE_MUSIC = 2,
CONTENT_TYPE_MOVIE = 3,
CONTENT_TYPE_SONIFICATION = 4,
CONTENT_TYPE_GAME = 5,
CONTENT_TYPE_TONE = 6
}
Possible mappings
Content Type | Value | Description | Focus Behavior | Typical Usage |
---|---|---|---|---|
CONTENT_TYPE_NONE | 0 | Unspecified content type | Default focus handling | Default fallback when content type is unknown |
CONTENT_TYPE_SPEECH | 1 | Human speech content | High priority for focus | Voice calls, voice assistants |
CONTENT_TYPE_MUSIC | 2 | Music content | Standard media focus, supports timed audio | Music streaming, audio players |
CONTENT_TYPE_MOVIE | 3 | Movie/video content | Standard media focus, supports timed audio | Video players, streaming apps |
CONTENT_TYPE_SONIFICATION | 4 | System sounds and UI feedback | Low priority focus | UI sounds, alerts |
CONTENT_TYPE_GAME | 5 | Game audio content | Standard media focus | Games |
CONTENT_TYPE_TONE | 6 | Simple tones | Low priority focus | Alert tones, notifications |
Note: For timed audio playback (synchronized audio), only CONTENT_TYPE_MUSIC and CONTENT_TYPE_MOVIE are supported when used with USAGE_MEDIA.
AudioUsageType
Description
Each value determines a different usage type of the playback stream. The usage type affects:
- Audio focus behavior (priority, ducking)
- Volume curve mapping
- Routing decisions
- Interaction with other audio streams
Possible Values
/**
* Enum for Audio Usage Types
*/
export enum AudioUsageType {
USAGE_NONE = 0,
USAGE_MEDIA = 1,
USAGE_COMMUNICATION = 2,
USAGE_ALARM = 3,
USAGE_NOTIFICATION = 4,
USAGE_ACCESSIBILITY = 5,
USAGE_ANNOUNCEMENT = 6,
USAGE_NAVIGATION = 7,
USAGE_RING = 8,
USAGE_VOICE_ASSISTANT = 9,
USAGE_SYSTEM = 10,
USAGE_VOICE_RECOGNITION = 11,
USAGE_VOICE_PROMPT = 12,
USAGE_SPOKEN_WORD_CONTENT = 13,
USAGE_TEXT_READER = 14
};
Possible Mappings
Usage Type | Value | Focus Priority | Focus Behavior | Volume Behavior | Typical Application |
---|---|---|---|---|---|
USAGE_NONE | 0 | Lowest | No focus management | Default curve | Fallback when usage is unknown |
USAGE_MEDIA | 1 | Standard | Can be ducked by higher priority | Media curve | Music, video players |
USAGE_COMMUNICATION | 2 | High | Ducks other streams | Communication curve | VoIP, calls |
USAGE_ALARM | 3 | High | Ducks media | Alarm curve | Alarm clock |
USAGE_NOTIFICATION | 4 | Low | Can be ducked | Notification curve | System notifications |
USAGE_ACCESSIBILITY | 5 | High | Ducks most other audio | Accessibility curve | Screen readers |
USAGE_ANNOUNCEMENT | 6 | Medium | Can duck lower priority | Announcement curve | Navigation prompts |
USAGE_NAVIGATION | 7 | High | Ducks media | Navigation curve | GPS apps |
USAGE_RING | 8 | High | Ducks media | Ring curve | Phone ringtones |
USAGE_VOICE_ASSISTANT | 9 | Highest | Ducks or pauses others | Assistant curve | Voice assistants |
USAGE_SYSTEM | 10 | System | System priority | System curve | System sounds |
USAGE_VOICE_RECOGNITION | 11 | High | Exclusive focus | Recognition curve | Voice input |
USAGE_VOICE_PROMPT | 12 | High | Ducks others | Prompt curve | System voice prompts |
USAGE_SPOKEN_WORD_CONTENT | 13 | Standard | Similar to media | Speech curve | Audiobooks |
USAGE_TEXT_READER | 14 | High | Ducks media | Reader curve | Text-to-speech |
Notes:
- Higher priority audio usage types can interrupt lower priority ones
- When interrupted, streams can be:
- Ducked (volume reduced)
- Paused
- Stopped
- Released
- Focus can be explicitly managed using AudioFocusSession
AudioStatus
Description
Represents different statuses that can occur when an audio API call is made. Each value represents whether a call was successful or returned an error.
Possible Values
`export enum AudioStatus {
/* Success */
STATUS_NO_ERROR = 0,
/* Failed to allocate memory */
STATUS_NO_MEMORY = -1,
/* Invalid arguments */
STATUS_BAD_VALUE = -2,
/* IPC receiver init failed */
STATUS_NO_INIT = -3,
/* Argument already set */
STATUS_ALREADY_EXISTS = -4,
/* IPC receiver process died */
STATUS_DEAD_OBJECT = -5,
/* Operation would block */
STATUS_WOULD_BLOCK = -6,
/* Operation timed out */
STATUS_TIMED_OUT = -7,
/* Invalid operation */
STATUS_INVALID_OPERATION = -8,
/* Insufficient privileges */
STATUS_PERMISSION_DENIED = -9,
/* No enough memory */
STATUS_NOT_ENOUGH_DATA = -10,
/* No such file or directory */
STATUS_NO_FILE = -11,
/* INT32_MIN value */
STATUS_UNKNOWN_ERROR = -2147483648
}; `
AudioVolumeType
Description
Each value represents a different volume type like media, voice call, navigation, etc.
For usage see the volume functions in:
AudioManager - VolumeAsync
AudioPlaybackStream - VolumeAsync
Possible Values
export enum AudioVolumeType {
VOLUME_TYPE_DEFAULT = -1,
VOLUME_TYPE_MEDIA = 0,
VOLUME_TYPE_VOICE_ASSISTANT = 1,
VOLUME_TYPE_VOICE_CALL = 2,
VOLUME_TYPE_RING = 3,
VOLUME_TYPE_ALARM = 4,
VOLUME_TYPE_NOTIFICATION = 5,
VOLUME_TYPE_ACCESSIBILITY = 6,
VOLUME_TYPE_SYSTEM = 7,
VOLUME_TYPE_NAVIGATION = 8
};
AudioVolumeFlags
Description
Each value represents a different type of audio volume flag. If SHOW_UI is set, a separate panel for volume control will appear. If PLAY_NOTIFICATION
is set, a tone will get played if volume either increases or decreases.
Possible Values
export enum AudioVolumeFlags {
VOLUME_FLAG_NONE = 0,
VOLUME_FLAG_SHOW_UI = 1,
VOLUME_FLAG_PLAY_NOTIFICATION = 2
};
AudioRole
Description
The possible role of an audio device
Possible Values
export enum AudioRole {
ROLE_SOURCE = 0,
ROLE_SINK = 1,
ROLE_SOURCE_SINK = 2
};
AudioDevice
Description
Available audio devices to be used
Possible Values
export enum AudioDevice {
DEVICE_NONE = 0x0,
DEVICE_DEFAULT = 1 << 30,
DEVICE_SPEAKER = 1 << 0,
DEVICE_WIRED_HEADSET = 1 << 1,
DEVICE_BLUETOOTH_SCO = 1 << 2,
DEVICE_BLUETOOTH_A2DP = 1 << 3,
DEVICE_AUX_LINE = 1 << 4,
DEVICE_AUX_DIGITAL = 1 << 5,
DEVICE_HDMI = 1 << 6,
DEVICE_HDMI_ARC = 1 << 7,
DEVICE_USB_HEADSET = 1 << 8,
DEVICE_USB_DEVICE = 1 << 9,
DEVICE_SPDIF = 1 << 10,
DEVICE_TERRESTRIAL_RADIO_TUNER = 1 << 11,
DEVICE_TV_TUNER = 1 << 12,
DEVICE_ECHO_CANCELLER = 1 << 13,
DEVICE_BUILTIN_MIC = 1 << 14,
DEVICE_LOOPBACK = 1 << 15,
DEVICE_PROXY = 1 << 16,
DEVICE_TELEPHONY = 1 << 17,
DEVICE_BLUETOOTH_HFP = 1 << 18,
DEVICE_BLUETOOTH_LE_REMOTE = 1 << 19,
DEVICE_SATELLITE_RADIO_TUNER = 1 << 20,
DEVICE_ALL = DEVICE_SPEAKER | DEVICE_WIRED_HEADSET |
DEVICE_BLUETOOTH_SCO |
DEVICE_BLUETOOTH_A2DP |
DEVICE_AUX_LINE |
DEVICE_AUX_DIGITAL |
DEVICE_HDMI |
DEVICE_HDMI_ARC |
DEVICE_USB_HEADSET |
DEVICE_USB_DEVICE |
DEVICE_SPDIF |
DEVICE_TERRESTRIAL_RADIO_TUNER |
DEVICE_TV_TUNER |
DEVICE_ECHO_CANCELLER |
DEVICE_BUILTIN_MIC |
DEVICE_LOOPBACK |
DEVICE_PROXY |
DEVICE_TELEPHONY |
DEVICE_BLUETOOTH_HFP |
DEVICE_BLUETOOTH_LE_REMOTE |
DEVICE_SATELLITE_RADIO_TUNER
};
AudioTelephonyMode
Description
Available Telephony modes
Possible Values
export enum AudioTelephonyMode {
MODE_NARROW_BAND = 0,
MODE_WIDE_BAND = 1
};
AudioEvent
Description
Each value represents a different type of audio change event that can occur, for example a VOLUME_UPDATE happens whenever volume is increased or decreased. These events will be sent to the registered callback.
Possible Values
export enum AudioEvent {
DEVICE_STATE_UPDATE = 0,
VOLUME_UPDATE = 1,
GLOBAL_VOLUME_MUTE_UPDATE = 2,
SERVER_DOWN = 3,
SERVER_UP = 4,
AUDIO_USAGE_STATE_CHANGE = 5,
MIC_MUTE_STATE_UPDATE = 6,
VOLUME_MUTE_UPDATE = 7,
TELEPHONY_MUTE_UPDATE = 8
};
AudioSampleRate
Description
Available values to define the sample rate used by playback streams
Possible Values
export enum AudioSampleRate {
SAMPLE_RATE_INVALID = -1,
SAMPLE_RATE_NONE = 0,
SAMPLE_RATE_2_KHZ = 2000,
SAMPLE_RATE_8_KHZ = 8000,
SAMPLE_RATE_11_025_KHZ = 11025,
SAMPLE_RATE_12_KHZ = 12000,
SAMPLE_RATE_16_KHZ = 16000,
SAMPLE_RATE_22_050_KHZ = 22050,
SAMPLE_RATE_24_KHZ = 24000,
SAMPLE_RATE_32_KHZ = 32000,
SAMPLE_RATE_44_1_KHZ = 44100,
SAMPLE_RATE_48_KHZ = 48000,
SAMPLE_RATE_64_KHZ = 64000,
SAMPLE_RATE_88_2_KHZ = 88200,
SAMPLE_RATE_96_KHZ = 96000,
SAMPLE_RATE_128_KHZ = 128000,
SAMPLE_RATE_176_4_KHZ = 176400,
SAMPLE_RATE_192_KHZ = 192000
};
AudioChannelMask
Description
Available channels to define the mask used by playback streams
Possible Values
export enum AudioChannelMask {
CHANNEL_NONE,
CHANNEL_INVALID,
CHANNEL_BIT_MAX,
/* start of individual channel bits */
CHANNEL_FRONT_LEFT,
CHANNEL_FRONT_RIGHT,
CHANNEL_FRONT_CENTER,
CHANNEL_LOW_FREQUENCY,
CHANNEL_BACK_LEFT,
CHANNEL_BACK_RIGHT,
CHANNEL_BACK_CENTER,
CHANNEL_SIDE_LEFT,
CHANNEL_SIDE_RIGHT,
CHANNEL_TOP_CENTER,
CHANNEL_TOP_FRONT_LEFT,
CHANNEL_TOP_FRONT_RIGHT,
CHANNEL_TOP_FRONT_CENTER,
CHANNEL_TOP_BACK_LEFT,
CHANNEL_TOP_BACK_RIGHT,
CHANNEL_TOP_BACK_CENTER,
CHANNEL_TOP_SIDE_LEFT,
CHANNEL_TOP_SIDE_RIGHT,
/**
* start of channel masks, position of channels are fixed as presented order for each entry.
* client side should always send in audio with the specified order. if not, routing of channel
* may become incorrect.
*/
CHANNEL_MONO,
CHANNEL_STEREO,
CHANNEL_3POINT1POINT1,
CHANNEL_QUAD,
CHANNEL_5POINT1,
CHANNEL_5POINT1_SIDE,
CHANNEL_5POINT1POINT2,
CHANNEL_5POINT1POINT2_SIDE,
CHANNEL_5POINT1POINT4,
CHANNEL_5POINT1POINT4_SIDE,
CHANNEL_7POINT1,
CHANNEL_7POINT1POINT2,
CHANNEL_7POINT1POINT4,
CHANNEL_ALL
};
AudioSampleFormat
Description
Available audio sample formats
Possible Values
export enum AudioSampleFormat {
FORMAT_PCM_8_BIT = 0,
FORMAT_PCM_16_BIT = 1,
FORMAT_PCM_24_BIT = 2,
FORMAT_PCM_32_BIT = 3,
FORMAT_PCM_FLOAT = 4,
FORMAT_PCM_24_BIT_PACKED = 5,
FORMAT_MP3 = 6,
FORMAT_AAC = 7,
FORMAT_OPUS = 8,
FORMAT_AC3 = 9,
FORMAT_E_AC3 = 10,
FORMAT_E_AC3_JOC = 11,
FORMAT_AC4 = 12,
FORMAT_MAT = 13
};
AudioFlags
Description
Each value determines a different flag for the playback stream.
Possible Values
export enum AudioFlags {
FLAG_NONE = 0x0,
/* Flag defining a behavior where the audibility of the sound will be ensured by the system. */
FLAG_AUDIBILITY_ENFORCED = 1 << 0,
/* Flag requesting the use of an output stream supporting hardware A/V synchronization. */
FLAG_HW_AV_SYNC = 1 << 1,
/* Flag indicating thin buffer and fast rendering loop frame. */
FLAG_LOW_LATENCY = 1 << 2,
/* Flag indicating large buffer and slow rendering loop frame for power consumption. */
FLAG_LOW_POWER = 1 << 3,
/* Flag indicating content is part of Whole Home Audio network distribution */
FLAG_TIMED_AUDIO = 1 << 4,
/* Flag indicating content is to be processed externally (DSP etc) */
FLAG_OFFLOAD = 1 << 5,
/* Flag indicating content is to be processed without rendering in mixer */
/* Platform specific, developer should query getSupportedPlaybackConfigurationsAsync()
to get the device capabilities before using this feature */
FLAG_PASSTHROUGH = 1 << 6,
FLAG_ALL = FLAG_AUDIBILITY_ENFORCED | FLAG_HW_AV_SYNC |
FLAG_LOW_LATENCY |
FLAG_LOW_POWER |
FLAG_TIMED_AUDIO |
FLAG_OFFLOAD |
FLAG_PASSTHROUGH
};
AudioConfig
Description
Determines the audio configuration to build the audio playback stream with, affects things like audio sample rate, and format.
Possible Values
export class AudioConfig {
sampleRate: AudioSampleRate = AudioSampleRate.SAMPLE_RATE_NONE;
channelMask: AudioChannelMask = AudioChannelMask.CHANNEL_NONE;
format: AudioSampleFormat = AudioSampleFormat.FORMAT_NONE;
};
AudioAttributes
Description
Determines the audio attributes to build the audio playback stream with, affects things like content type, usage, and flags.
Possible Values
export class AudioAttributes {
contentType: AudioContentType = AudioContentType.CONTENT_TYPE_NONE;
usage: AudioUsageType = AudioUsageType.USAGE_NONE;
flags: AudioFlags = AudioFlags.FLAG_NONE;
tag: string = "";
};
AudioDeviceInfo
Description
Data type which contains the description of an audio device
Possible Values
export class AudioDeviceInfo {
role: AudioRole = AudioRole.ROLE_SOURCE;
type: AudioDevice = AudioDevice.DEVICE_NONE;
name: String = "";
formats: AudioSampleFormat[];
sampleRates: AudioSampleRate[];
channelMasks: AudioChannelMask[];
};
AudioSource
Description
Possible audio sources
Possible Values
export enum AudioSource {
NONE = 0,
RAW = 1,
VOICE_COMMUNICATION = 2,
WAKEWORD = 3,
CAMCORDER = 4,
VOICE_RECOGNITION = 5,
ULTRASOUND = 6,
TAP_DETECTION = 7,
BLUETOOTH_A2DP = 8,
BLUETOOTH_SCO = 9
};
AudioSystemSound
Description
Available system sound types to be used
Possible Values
export enum AudioSystemSound {
BOOT_UP = 0,
BACK_BUTTON = 1,
HOME_BUTTON_DOUBLE_TAP = 2,
HOME_BUTTON_LONG_PRESS = 3,
HOME_BUTTON = 4,
MENU_BUTTON = 5,
LEFT = 6,
RIGHT = 7,
UP = 8,
DOWN = 9,
MIC_OFF = 10,
MIC_ON = 11,
BLUETOOTH_PAIRING = 12,
BLUETOOTH_PAIRED = 13,
BLUETOOTH_UNPAIRED = 14,
ERROR = 15,
VOLUME_UP = 16,
VOLUME_DOWN = 17,
PLAY = 18,
SELECT = 19,
CLICK = 20,
KEYPRESS_SET = 21,
KEYPRESS_REJECT = 22,
KEYPRESS_NORMAL = 23,
NOTIFICATION_STANDARD = 24,
ALERT_SPORT = 25,
ALERT_FAVORITE = 26,
ALERT_TRAFFIC = 27,
ALERT_WEATHER = 28,
ALERT_APP = 29,
CUSTOM_1 = 257,
CUSTOM_2 = 258,
CUSTOM_3 = 259,
CUSTOM_4 = 260,
CUSTOM_5 = 261
};
SampleLayout
Description
Available audio sample layouts
Possible Values
export enum SampleLayout {
INTERLEAVED = 0, DEINTERLEAVED = 1
};
SinkFormatsSelectionPolicy
Description
Available audio mode for hdmi output
Possible Values
export enum SinkFormatsSelectionPolicy {
/**
* Support formats based on Sink device capabilities.
*/
AUTO = 0,
/**
* Support only PCM formats.
*/
ENFORCE_PCM = 1,
/**
* Support PCM and Passthrough Dolby Digital Plus formats.
* The applications are allowed to stream PCM or Dolby Digital Plus audio formats.
* The sink format will be set to same as input audio format.
*/
PASSTHROUGH_DDP = 2,
/**
* Support PCM and Passthrough Dolby Digital formats.
* The applications are allowed to stream PCM or Dolby Digital audio formats.
* The sink format will be set to same as input audio format.
*/
PASSTHROUGH_DD = 3,
/**
* Set the sink format to Dolby Digital Plus always.
* If the application feeds audio in any other format, it will be transcoded
* to Dolby Digital Plus.
*/
ENFORCE_DDP = 4,
/**
* Set the sink format to Dolby Digital always.
* If the application feeds audio in any other format, it will be transcoded
* to Dolby Digital.
*/
ENFORCE_DD = 5
};
StreamDuckingPolicy
Description
Available audio ducking policies
Possible Values
export enum StreamDuckingPolicy {
SYSTEM = 0, /* System duck volume when audio focus ducked */
EXPLICIT = 1 /* Apps must call duckVolume when audio focus ducked */
}
AudioPlaybackEvent
Description
Possible playback events used by the playback builder
Possible Values
export enum AudioPlaybackEvent {
DIED = 0,
RECOVERED = 1,
STOPPED = 2,
MUTE_STATE_UPDATE = 3,
FRAME_UNDERRUN = 4
};
DuckingMode
Description
Possible modes to define the audio ducking level.
Possible Values
export enum DuckingMode { INVALID = -1, DB = 0, PERCENTAGE = 1 };
AudioFocusStatus
Description
Represents different statuses that can occur when an audio focus call is made. Each value represents whether a call was successful or returned an error.
Possible Values
export enum AudioFocusStatus {
/* Invalid operation */
AUDIO_FOCUS_STATUS_INVALID_OPERATION = -8,
/* Not initialized yet */
AUDIO_FOCUS_STATUS_NO_INIT = -3,
/* Invalid parameter */
AUDIO_FOCUS_STATUS_BAD_VALUE = -2,
/** Time out*/
AUDIO_FOCUS_STATUS_TIMED_OUT = -1,
/* Success */
AUDIO_FOCUS_STATUS_NO_ERROR = 0,
/* Denied */
AUDIO_FOCUS_STATUS_DENIED = 1,
/* Failed to grant audio focus as of now, but may grant later. * AUDIO_FOCUS_FLAG_DELAYABLE should be specified during requesting audio focus */
AUDIO_FOCUS_STATUS_DELAYED = 2,
};
AudioFocusAttributes
Description
Each value represents behavior for audio focus to be handled when focus is requested by a session.
Possible Values
export class AudioFocusAttributes {
usage: AudioCoreClientTypes.AudioUsageType = AudioCoreClientTypes.AudioUsageType.USAGE_MEDIA;
};
AudioFocusChange
Description
Each value represents a different type of audio focus change event that can occur, for example GRANTED represents when audio focus has been granted to a source.
Possible Values
export enum AudioFocusChange {
GRANTED = 0,
RELEASED = 1,
DUCKED = 2,
PAUSED = 3,
STOPPED = 4,
};
Last updated: Oct 02, 2025