• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Enums
2
3> **NOTE**
4>
5> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
6
7## AudioVolumeType
8
9Enumerates the audio stream types.
10
11**System capability**: SystemCapability.Multimedia.Audio.Volume
12
13| Name                        | Value     | Description      |
14| ---------------------------- | ------ | ---------- |
15| VOICE_CALL<sup>8+</sup>      | 0      | Audio stream for voice calls.|
16| RINGTONE                     | 2      | Audio stream for ringtones.    |
17| MEDIA                        | 3      | Audio stream for media purpose.    |
18| ALARM<sup>10+</sup>          | 4      | Audio stream for alarming.    |
19| ACCESSIBILITY<sup>10+</sup>  | 5      | Audio stream for accessibility.  |
20| VOICE_ASSISTANT<sup>8+</sup> | 9      | Audio stream for voice assistant.|
21
22## InterruptMode<sup>9+</sup>
23
24Enumerates the audio interruption modes.
25
26**Atomic service API**: This API can be used in atomic services since API version 12.
27
28**System capability**: SystemCapability.Multimedia.Audio.Interrupt
29
30| Name                        | Value     | Description      |
31| ---------------------------- | ------ | ---------- |
32| SHARE_MODE                   | 0      | Shared mode.|
33| INDEPENDENT_MODE             | 1      | Independent mode.|
34
35## DeviceFlag
36
37Enumerates the audio device flags.
38
39**System capability**: SystemCapability.Multimedia.Audio.Device
40
41| Name                           |  Value    | Description                       |
42| ------------------------------- | ------ |---------------------------|
43| OUTPUT_DEVICES_FLAG             | 1      | Output device.                    |
44| INPUT_DEVICES_FLAG              | 2      | Input device.                    |
45| ALL_DEVICES_FLAG                | 3      | All devices.                    |
46
47## DeviceUsage<sup>12+</sup>
48
49Enumerates the audio device types by usage.
50
51**System capability**: SystemCapability.Multimedia.Audio.Device
52
53| Name                           |  Value    | Description                       |
54| ------------------------------- | ------ |---------------------------|
55| MEDIA_OUTPUT_DEVICES | 1      | Media output device.|
56| MEDIA_INPUT_DEVICES  | 2      | Media input device.|
57| ALL_MEDIA_DEVICES    | 3      | All media devices.|
58| CALL_OUTPUT_DEVICES  | 4      | Call output device.|
59| CALL_INPUT_DEVICES   | 8      | Call input device.|
60| ALL_CALL_DEVICES     | 12     | All call devices.|
61
62## DeviceRole
63
64Enumerates the device roles.
65
66**Atomic service API**: This API can be used in atomic services since API version 12.
67
68**System capability**: SystemCapability.Multimedia.Audio.Device
69
70| Name         |  Value   | Description          |
71| ------------- | ------ | -------------- |
72| INPUT_DEVICE  | 1      | Input role.|
73| OUTPUT_DEVICE | 2      | Output role.|
74
75## DeviceType
76
77Enumerates the device types.
78
79**System capability**: SystemCapability.Multimedia.Audio.Device
80
81| Name                | Value    | Description                                                     |
82| ---------------------| ------ | --------------------------------------------------------- |
83| INVALID              | 0      | Invalid device.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
84| EARPIECE             | 1      | Earpiece.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
85| SPEAKER              | 2      | Speaker.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
86| WIRED_HEADSET        | 3      | Wired headset with a microphone.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
87| WIRED_HEADPHONES     | 4      | Wired headset without a microphone.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
88| BLUETOOTH_SCO        | 7      | Bluetooth device using Synchronous Connection Oriented (SCO) links.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
89| BLUETOOTH_A2DP       | 8      | Bluetooth device using Advanced Audio Distribution Profile (A2DP) links.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
90| MIC                  | 15     | Microphone.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
91| USB_HEADSET          | 22     | USB Type-C headset.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
92| DISPLAY_PORT<sup>12+</sup>        | 23     | Display port (DP), which is used to connect to external devices.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
93| REMOTE_CAST<sup>12+</sup>        | 24     | Remote cast device.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
94| USB_DEVICE<sup>18+</sup>        | 25 | USB device (excluding USB headsets).          |
95| HDMI<sup>19+</sup>        | 27 | HDMI device (such as HDMI, ARC, and eARC).          |
96| LINE_DIGITAL<sup>19+</sup>        | 28 | Wired digital device (such as S/PDIF)          |
97| REMOTE_DAUDIO<sup>18+</sup>        | 29 | Distributed device.<br>**Atomic service API**: This API can be used in atomic services since API version 18.|
98| NEARLINK<sup>20+</sup>        | 31 | NearLink device.|
99| DEFAULT<sup>9+</sup> | 1000   | Default device type.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
100
101## CommunicationDeviceType<sup>9+</sup>
102
103Enumerates the device types used for communication.
104
105**System capability**: SystemCapability.Multimedia.Audio.Communication
106
107| Name         | Value    | Description         |
108| ------------- | ------ | -------------|
109| SPEAKER       | 2      | Speaker.     |
110
111## AudioRingMode
112
113Enumerates the audio ring modes.
114
115**System capability**: SystemCapability.Multimedia.Audio.Communication
116
117| Name               |  Value   | Description      |
118| ------------------- | ------ | ---------- |
119| RINGER_MODE_SILENT  | 0      | Silent mode.|
120| RINGER_MODE_VIBRATE | 1      | Vibration mode.|
121| RINGER_MODE_NORMAL  | 2      | Normal mode.|
122
123## AudioSampleFormat<sup>8+</sup>
124
125Enumerates the audio sample formats.
126
127**System capability**: SystemCapability.Multimedia.Audio.Core
128
129| Name                               |  Value   | Description                      |
130| ---------------------------------- | ------ | -------------------------- |
131| SAMPLE_FORMAT_INVALID              | -1     | Invalid format.                |
132| SAMPLE_FORMAT_U8                   | 0      | Unsigned 8-bit integer.           |
133| SAMPLE_FORMAT_S16LE                | 1      | Signed 16-bit integer, little endian.|
134| SAMPLE_FORMAT_S24LE                | 2      | Signed 24-bit integer, little endian.<br>Due to system restrictions, only some devices support this sampling format.|
135| SAMPLE_FORMAT_S32LE                | 3      | Signed 32-bit integer, little endian.<br>Due to system restrictions, only some devices support this sampling format.|
136| SAMPLE_FORMAT_F32LE<sup>9+</sup>   | 4      | Signed 32-bit floating point number, little endian.<br>Due to system restrictions, only some devices support this sampling format.|
137
138## AudioErrors<sup>9+</sup>
139
140Enumerates the error codes available for audio management.
141
142**System capability**: SystemCapability.Multimedia.Audio.Core
143
144| Name                | Value     | Description        |
145| ---------------------| --------| ----------------- |
146| ERROR_INVALID_PARAM  | 6800101 | Invalid parameter.        |
147| ERROR_NO_MEMORY      | 6800102 | Memory allocation failure.    |
148| ERROR_ILLEGAL_STATE  | 6800103 | Unsupported state.      |
149| ERROR_UNSUPPORTED    | 6800104 | Unsupported parameter value.   |
150| ERROR_TIMEOUT        | 6800105 | Processing timeout.        |
151| ERROR_STREAM_LIMIT   | 6800201 | Too many audio streams.|
152| ERROR_SYSTEM         | 6800301 | System error.    |
153
154## AudioChannel<sup>8+</sup>
155
156Enumerates the audio channels.
157
158**System capability**: SystemCapability.Multimedia.Audio.Core
159
160| Name     |  Value      | Description  |
161| --------- | -------- |------|
162| CHANNEL_1 | 1 | One audio channel (mono).|
163| CHANNEL_2 | 2 | Two audio channels (stereo).|
164| CHANNEL_3<sup>11+</sup> | 3 | Three audio channels.|
165| CHANNEL_4<sup>11+</sup> | 4 | Four audio channels.|
166| CHANNEL_5<sup>11+</sup> | 5 | Five audio channels.|
167| CHANNEL_6<sup>11+</sup> | 6 | Six audio channels.|
168| CHANNEL_7<sup>11+</sup> | 7 | Seven audio channels.|
169| CHANNEL_8<sup>11+</sup> | 8 | Eight audio channels.|
170| CHANNEL_9<sup>11+</sup> | 9 | Nine audio channels.|
171| CHANNEL_10<sup>11+</sup> | 10 | Ten audio channels.|
172| CHANNEL_12<sup>11+</sup> | 12 | Twelve audio channels.|
173| CHANNEL_14<sup>11+</sup> | 14 | Fourteen audio channels.|
174| CHANNEL_16<sup>11+</sup> | 16 | Sixteen audio channels.|
175
176## AudioSamplingRate<sup>8+</sup>
177
178Enumerates the audio sampling rates. The sampling rates supported vary according to the device in use.
179
180**System capability**: SystemCapability.Multimedia.Audio.Core
181
182| Name             |  Value   | Description           |
183| ----------------- | ------ | --------------- |
184| SAMPLE_RATE_8000  | 8000   | The sampling rate is 8000. |
185| SAMPLE_RATE_11025 | 11025  | The sampling rate is 11025.|
186| SAMPLE_RATE_12000 | 12000  | The sampling rate is 12000.|
187| SAMPLE_RATE_16000 | 16000  | The sampling rate is 16000.|
188| SAMPLE_RATE_22050 | 22050  | The sampling rate is 22050.|
189| SAMPLE_RATE_24000 | 24000  | The sampling rate is 24000.|
190| SAMPLE_RATE_32000 | 32000  | The sampling rate is 32000.|
191| SAMPLE_RATE_44100 | 44100  | The sampling rate is 44100.|
192| SAMPLE_RATE_48000 | 48000  | The sampling rate is 48000.|
193| SAMPLE_RATE_64000 | 64000  | The sampling rate is 64000.|
194| SAMPLE_RATE_88200<sup>12+</sup> | 88200  | The sampling rate is 88200.|
195| SAMPLE_RATE_96000 | 96000  | The sampling rate is 96000.|
196| SAMPLE_RATE_176400<sup>12+</sup> | 176400  | The sampling rate is 176400.|
197| SAMPLE_RATE_192000<sup>12+</sup> | 192000  | The sampling rate is 192000.|
198
199## AudioEncodingType<sup>8+</sup>
200
201Enumerates the audio encoding types.
202
203**Atomic service API**: This API can be used in atomic services since API version 12.
204
205**System capability**: SystemCapability.Multimedia.Audio.Core
206
207| Name                 |  Value   | Description     |
208| --------------------- | ------ | --------- |
209| ENCODING_TYPE_INVALID | -1     | Invalid.   |
210| ENCODING_TYPE_RAW     | 0      | PCM encoding.|
211
212## AudioChannelLayout<sup>11+</sup>
213
214Enumerates the audio channel layouts of audio files.
215
216**System capability**: SystemCapability.Multimedia.Audio.Core
217
218| Name                           |  Value             | Description                                         |
219| ------------------------------ | ---------------- | --------------------------------------------- |
220| CH_LAYOUT_UNKNOWN              | 0x0              | Unknown.                                |
221| CH_LAYOUT_MONO                 | 0x4              | Mono.                              |
222| CH_LAYOUT_STEREO               | 0x3              | Stereo.                            |
223| CH_LAYOUT_STEREO_DOWNMIX       | 0x60000000       | Stereo downmix.                    |
224| CH_LAYOUT_2POINT1              | 0xB              | 2.1.                               |
225| CH_LAYOUT_3POINT0              | 0x103            | 3.0.                               |
226| CH_LAYOUT_SURROUND             | 0x7              | Surround.                          |
227| CH_LAYOUT_3POINT1              | 0xF              | 3.1.                               |
228| CH_LAYOUT_4POINT0              | 0x107            | 4.0.                               |
229| CH_LAYOUT_QUAD                 | 0x33             | Quad.                              |
230| CH_LAYOUT_QUAD_SIDE            | 0x603            | Quad side.                         |
231| CH_LAYOUT_2POINT0POINT2        | 0x3000000003     | 2.0.2.                             |
232| CH_LAYOUT_AMB_ORDER1_ACN_N3D   | 0x100000000001   | First-order FOA file in ACN_N3D (ITU standards). |
233| CH_LAYOUT_AMB_ORDER1_ACN_SN3D  | 0x100000001001   | First-order FOA file in ACN_SN3D (ITU standards).|
234| CH_LAYOUT_AMB_ORDER1_FUMA      | 0x100000000101   | First-order FOA file in FUMA (ITU standards).    |
235| CH_LAYOUT_4POINT1              | 0x10F            | 4.1.                                 |
236| CH_LAYOUT_5POINT0              | 0x607            | 5.0.                               |
237| CH_LAYOUT_5POINT0_BACK         | 0x37             | 5.0 back.                          |
238| CH_LAYOUT_2POINT1POINT2        | 0x300000000B     | 2.1.2.                             |
239| CH_LAYOUT_3POINT0POINT2        | 0x3000000007     | 3.0.2.                             |
240| CH_LAYOUT_5POINT1              | 0x60F            | 5.1.                               |
241| CH_LAYOUT_5POINT1_BACK         | 0x3F             | 5.1 back.                          |
242| CH_LAYOUT_6POINT0              | 0x707            | 6.0.                               |
243| CH_LAYOUT_HEXAGONAL            | 0x137            | Hexagonal.                         |
244| CH_LAYOUT_3POINT1POINT2        | 0x500F           | 3.1.2.                             |
245| CH_LAYOUT_6POINT0_FRONT        | 0x6C3            | 6.0 front.                         |
246| CH_LAYOUT_6POINT1              | 0x70F            | 6.1.                               |
247| CH_LAYOUT_6POINT1_BACK         | 0x13F            | 6.1 back.                          |
248| CH_LAYOUT_6POINT1_FRONT        | 0x6CB            | 6.1 front.                         |
249| CH_LAYOUT_7POINT0              | 0x637            | 7.0.                               |
250| CH_LAYOUT_7POINT0_FRONT        | 0x6C7            | 7.0 front.                         |
251| CH_LAYOUT_7POINT1              | 0x63F            | 7.1.                               |
252| CH_LAYOUT_OCTAGONAL            | 0x737            | Octagonal.                         |
253| CH_LAYOUT_5POINT1POINT2        | 0x300000060F     | 5.1.2.                             |
254| CH_LAYOUT_7POINT1_WIDE         | 0x6CF            | 7.1 wide.                          |
255| CH_LAYOUT_7POINT1_WIDE_BACK    | 0xFF             | 7.1 wide back.                     |
256| CH_LAYOUT_AMB_ORDER2_ACN_N3D   | 0x100000000002   | Second-order HOA file in ACN_N3D (ITU standards). |
257| CH_LAYOUT_AMB_ORDER2_ACN_SN3D  | 0x100000001002   | Second-order HOA file in ACN_SN3D (ITU standards).|
258| CH_LAYOUT_AMB_ORDER2_FUMA      | 0x100000000102   | Second-order HOA file in FUMA (ITU standards).    |
259| CH_LAYOUT_5POINT1POINT4        | 0x2D60F          | 5.1.4.                             |
260| CH_LAYOUT_7POINT1POINT2        | 0x300000063F     | 7.1.2.                             |
261| CH_LAYOUT_7POINT1POINT4        | 0x2D63F          | 7.1.4.                             |
262| CH_LAYOUT_10POINT2             | 0x180005737      | 10.2.                              |
263| CH_LAYOUT_9POINT1POINT4        | 0x18002D63F      | 9.1.4.                             |
264| CH_LAYOUT_9POINT1POINT6        | 0x318002D63F     | 9.1.6.                             |
265| CH_LAYOUT_HEXADECAGONAL        | 0x18003F737      | Hexadecagonal.                     |
266| CH_LAYOUT_AMB_ORDER3_ACN_N3D   | 0x100000000003   | Third-order HOA file in ACN_N3D (ITU standards). |
267| CH_LAYOUT_AMB_ORDER3_ACN_SN3D  | 0x100000001003   | Third-order HOA file in ACN_SN3D (ITU standards).|
268| CH_LAYOUT_AMB_ORDER3_FUMA      | 0x100000000103   | Third-order HOA file in FUMA (ITU standards).    |
269
270## StreamUsage
271
272Enumerates the audio stream usage types.
273
274**System capability**: SystemCapability.Multimedia.Audio.Core
275
276| Name                                     |  Value   | Description                                                                            |
277| ------------------------------------------| ------ |--------------------------------------------------------------------------------|
278| STREAM_USAGE_UNKNOWN                      | 0      | Unknown content.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
279| STREAM_USAGE_MEDIA<sup>(deprecated)</sup> | 1      | Media.<br> This enumerated value is supported since API version 7 and deprecated since API version 10. You are advised to use **STREAM_USAGE_MUSIC**, **STREAM_USAGE_MOVIE**, **STREAM_USAGE_GAME**, or **STREAM_USAGE_AUDIOBOOK** instead.|
280| STREAM_USAGE_MUSIC<sup>10+</sup>          | 1      | Music.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
281| STREAM_USAGE_VOICE_COMMUNICATION          | 2      | VoIP voice call.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
282| STREAM_USAGE_VOICE_ASSISTANT<sup>9+</sup> | 3      | Voice assistant.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
283| STREAM_USAGE_ALARM<sup>10+</sup>          | 4      | Audio stream for alarming.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
284| STREAM_USAGE_VOICE_MESSAGE<sup>10+</sup>  | 5      | Voice message.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
285| STREAM_USAGE_NOTIFICATION_RINGTONE<sup>(deprecated)</sup> | 6      | Notification tone.<br> This enumerated value is supported since API version 7 and deprecated since API version 10. You are advised to use **STREAM_USAGE_RINGTONE** instead.|
286| STREAM_USAGE_RINGTONE<sup>10+</sup>       | 6      | Ringtone.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
287| STREAM_USAGE_NOTIFICATION<sup>10+</sup>   | 7      | Notification.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
288| STREAM_USAGE_ACCESSIBILITY<sup>10+</sup>  | 8      | Accessibility.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
289| STREAM_USAGE_MOVIE<sup>10+</sup>          | 10     | Movie or video.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
290| STREAM_USAGE_GAME<sup>10+</sup>           | 11     | Gaming.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
291| STREAM_USAGE_AUDIOBOOK<sup>10+</sup>      | 12     | Audiobooks (including crosstalks and storytelling), news radio, and podcasts.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
292| STREAM_USAGE_NAVIGATION<sup>10+</sup>     | 13     | Navigation.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
293| STREAM_USAGE_VIDEO_COMMUNICATION<sup>12+</sup>     | 17     | VoIP video call.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
294
295## AudioState<sup>8+</sup>
296
297Enumerates the audio states.
298
299**System capability**: SystemCapability.Multimedia.Audio.Core
300
301| Name          | Value    | Description            |
302| -------------- | ------ | ---------------- |
303| STATE_INVALID  | -1     | Invalid state.      |
304| STATE_NEW      | 0      | Creating instance state.|
305| STATE_PREPARED | 1      | Prepared.      |
306| STATE_RUNNING  | 2      | Running.|
307| STATE_STOPPED  | 3      | Stopped.      |
308| STATE_RELEASED | 4      | Released.      |
309| STATE_PAUSED   | 5      | Paused.      |
310
311## AudioEffectMode<sup>10+</sup>
312
313Enumerates the audio effect modes.
314
315**Atomic service API**: This API can be used in atomic services since API version 12.
316
317**System capability**: SystemCapability.Multimedia.Audio.Renderer
318
319| Name              | Value    | Description      |
320| ------------------ | ------ | ---------- |
321| EFFECT_NONE        | 0      | The audio effect is disabled.|
322| EFFECT_DEFAULT     | 1      | The default audio effect is used.|
323
324## AudioRendererRate<sup>8+</sup>
325
326Enumerates the audio renderer rates.
327
328**System capability**: SystemCapability.Multimedia.Audio.Renderer
329
330| Name              | Value    | Description      |
331| ------------------ | ------ | ---------- |
332| RENDER_RATE_NORMAL | 0      | Normal rate.|
333| RENDER_RATE_DOUBLE | 1      | Double rate.   |
334| RENDER_RATE_HALF   | 2      | 0.5x rate. |
335
336## InterruptType
337
338Enumerates the audio interruption types.
339
340**Atomic service API**: This API can be used in atomic services since API version 12.
341
342**System capability**: SystemCapability.Multimedia.Audio.Renderer
343
344| Name                |  Value    | Description                  |
345| -------------------- | ------ | ---------------------- |
346| INTERRUPT_TYPE_BEGIN | 1      | Audio interruption started.|
347| INTERRUPT_TYPE_END   | 2      | Audio interruption ended.|
348
349## InterruptForceType<sup>9+</sup>
350
351Enumerates the types of force that causes audio interruption.
352
353The force type is obtained when an [InterruptEvent](arkts-apis-audio-i.md#interruptevent9) is received.
354
355This type specifies whether audio interruption is forcibly performed by the system. The operation information (such as audio pause or stop) can be obtained through [InterruptHint](#interrupthint). For details about the audio interruption strategy, see [Introduction to Audio Focus and Audio Sessions](../../media/audio/audio-playback-concurrency.md).
356
357**Atomic service API**: This API can be used in atomic services since API version 12.
358
359**System capability**: SystemCapability.Multimedia.Audio.Renderer
360
361| Name           |  Value   | Description                                |
362| --------------- | ------ | ------------------------------------ |
363| INTERRUPT_FORCE | 0      | The operation is forcibly performed by the system.  |
364| INTERRUPT_SHARE | 1      | The operation will not be performed by the system. [InterruptHint](#interrupthint) is used to provide recommended operations for the application, and the application can determine the next processing mode.|
365
366## InterruptHint
367
368Enumerates the hints provided along with audio interruption.
369
370The hint is obtained when an [InterruptEvent](arkts-apis-audio-i.md#interruptevent9) is received.
371
372The hint specifies the operation (such as audio pause or volume adjustment) to be performed on audio streams based on the focus strategy.
373
374You can determine whether the operation is forcibly performed by the system based on [InterruptForceType](#interruptforcetype9) in **InterruptEvent**. For details, see [Introduction to Audio Focus and Audio Sessions](../../media/audio/audio-playback-concurrency.md).
375
376**System capability**: SystemCapability.Multimedia.Audio.Renderer
377
378| Name                              |  Value    | Description                                        |
379| ---------------------------------- | ------ | -------------------------------------------- |
380| INTERRUPT_HINT_NONE<sup>8+</sup>   | 0      | None.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
381| INTERRUPT_HINT_RESUME              | 1      | A hint is displayed, indicating that the audio stream is restored. The application can proactively trigger operations related to rendering or recording.<br>This operation cannot be forcibly performed by the system, and the corresponding [InterruptForceType](#interruptforcetype9) must be **INTERRUPT_SHARE**.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
382| INTERRUPT_HINT_PAUSE               | 2      | A hint is displayed, indicating that the audio stream is paused and the audio focus is lost temporarily.<br>When the audio focus is available, the **INTERRUPT_HINT_RESUME** event is received.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
383| INTERRUPT_HINT_STOP                | 3      | A hint is displayed, indicating that the audio stream stops and the audio focus is lost.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
384| INTERRUPT_HINT_DUCK                | 4      | A hint is displayed, indicating that audio ducking starts and the audio is played at a lower volume.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
385| INTERRUPT_HINT_UNDUCK<sup>8+</sup> | 5      | A hint is displayed, indicating that audio ducking ends and the audio is played at the normal volume.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
386| INTERRUPT_HINT_MUTE<sup>20+</sup> | 6      | A hint is displayed, indicating that the audio is muted.|
387| INTERRUPT_HINT_UNMUTE<sup>20+</sup> | 7      | A hint is displayed, indicating that the audio is unmuted.           |
388
389## AudioVolumeMode<sup>19+</sup>
390
391Enumerates the audio volume modes.
392
393**System capability**: SystemCapability.Multimedia.Audio.Volume
394
395| Name          | Value    | Description          |
396| -------------- | ------ |--------------|
397| SYSTEM_GLOBAL  | 0 | System-level volume (default mode).|
398| APP_INDIVIDUAL | 1 | Application-level volume.      |
399
400## AudioPrivacyType<sup>10+</sup>
401
402Enumerates whether an audio stream can be recorded by other applications.
403
404**System capability**: SystemCapability.Multimedia.Audio.PlaybackCapture
405
406| Name                | Value  | Description                            |
407| -------------------- | ---- | -------------------------------- |
408| PRIVACY_TYPE_PUBLIC  | 0    | The audio stream can be recorded by other applications.  |
409| PRIVACY_TYPE_PRIVATE | 1    | The audio stream cannot be recorded by other applications.|
410
411## ChannelBlendMode<sup>11+</sup>
412
413Enumerates the audio channel blending modes.
414
415**System capability**: SystemCapability.Multimedia.Audio.Core
416
417| Name                                        |  Value    | Description                  |
418| :------------------------------------------- | :----- | :--------------------- |
419| MODE_DEFAULT | 0     | No channel mixing. |
420| MODE_BLEND_LR | 1      | Blends the left and right channels together.|
421| MODE_ALL_LEFT | 2      | Copies the left channel and applies it to both the left and right channels. |
422| MODE_ALL_RIGHT | 3 | Copies the right channel and applies it to both the left and right channels. |
423
424## AudioStreamDeviceChangeReason<sup>11+</sup>
425
426Enumerates the reasons for audio stream device changes.
427
428**Atomic service API**: This API can be used in atomic services since API version 12.
429
430**System capability**: SystemCapability.Multimedia.Audio.Device
431
432| Name                                       |  Value    | Description             |
433|:------------------------------------------| :----- |:----------------|
434| REASON_UNKNOWN | 0 | Unknown reason.          |
435| REASON_NEW_DEVICE_AVAILABLE | 1 | A new device is available.        |
436| REASON_OLD_DEVICE_UNAVAILABLE | 2 | The old device is unavailable. When this reason is reported, consider pausing audio playback.|
437| REASON_OVERRODE | 3 | Forcibly selected.|
438
439## DeviceChangeType
440
441Enumerates the device connection statuses.
442
443**System capability**: SystemCapability.Multimedia.Audio.Device
444
445| Name      | Value  | Description          |
446| :--------- | :--- | :------------- |
447| CONNECT    | 0    | Connected.    |
448| DISCONNECT | 1    | Disconnected.|
449
450## DeviceBlockStatus<sup>13+</sup>
451
452Enumerates the blocked statuses of audio devices.
453
454**System capability**: SystemCapability.Multimedia.Audio.Device
455
456| Name      | Value  | Description          |
457| :--------- | :--- | :------------- |
458| UNBLOCKED  | 0    | The audio device is not blocked.   |
459| BLOCKED    | 1    | The audio device is blocked.|
460
461## SourceType<sup>8+</sup>
462
463Enumerates the audio source types.
464
465| Name                                        |  Value    | Description                  |
466| :------------------------------------------- | :----- | :--------------------- |
467| SOURCE_TYPE_INVALID                          | -1     | Invalid audio source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core |
468| SOURCE_TYPE_MIC                              | 0      | Mic source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
469| SOURCE_TYPE_VOICE_RECOGNITION<sup>9+</sup>   | 1      | Voice recognition source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core |
470| SOURCE_TYPE_PLAYBACK_CAPTURE<sup>(deprecated)</sup>   | 2 | Internal audio recording source.<br>**System capability**: SystemCapability.Multimedia.Audio.PlaybackCapture<br> This API is supported since API version 10 and deprecated since API version 12. You are advised to use [AVScreenCapture](../apis-media-kit/capi-avscreencapture.md) instead. |
471| SOURCE_TYPE_VOICE_COMMUNICATION              | 7      | Voice communication source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
472| SOURCE_TYPE_VOICE_MESSAGE<sup>12+</sup>      | 10     | Voice message source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
473| SOURCE_TYPE_CAMCORDER<sup>13+</sup>          | 13     | Video recording source.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
474| SOURCE_TYPE_UNPROCESSED<sup>14+</sup>     | 14 |  Audio source for raw microphone recording, where the system does not perform any algorithm processing.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
475|  SOURCE_TYPE_LIVE<sup>20+</sup>     | 17 |  Audio source in live streaming scenarios.<br>**System capability**: SystemCapability.Multimedia.Audio.Core|
476
477## AudioScene<sup>8+</sup>
478
479Enumerates the audio scenes.
480
481**System capability**: SystemCapability.Multimedia.Audio.Communication
482
483| Name                  |  Value    | Description                                         |
484| :--------------------- | :----- | :-------------------------------------------- |
485| AUDIO_SCENE_DEFAULT                  | 0      | Default audio scene.                               |
486| AUDIO_SCENE_RINGING<sup>12+</sup>    | 1      | Normal mode.|
487| AUDIO_SCENE_PHONE_CALL<sup>12+</sup> | 2      | Phone call scene.|
488| AUDIO_SCENE_VOICE_CHAT               | 3      | Voice chat scene.                               |
489
490## AudioConcurrencyMode<sup>12+</sup>
491
492Enumerates the audio concurrency modes.
493
494**System capability**: SystemCapability.Multimedia.Audio.Core
495
496| Name                  | Value| Description     |
497| :--------------------- |:--|:--------|
498| CONCURRENCY_DEFAULT | 0 | Uses the system strategy by default.    |
499| CONCURRENCY_MIX_WITH_OTHERS | 1 | Mixes with other audio streams.    |
500| CONCURRENCY_DUCK_OTHERS | 2 | Ducks other audio streams.|
501| CONCURRENCY_PAUSE_OTHERS | 3 | Pauses other audio streams.|
502
503## AudioSessionDeactivatedReason<sup>12+</sup>
504
505Enumerates the reasons for deactivating an audio session.
506
507**System capability**: SystemCapability.Multimedia.Audio.Core
508
509| Name                  | Value| Description    |
510| :--------------------- |:--|:-------|
511| DEACTIVATED_LOWER_PRIORITY | 0 | The application focus is preempted.|
512| DEACTIVATED_TIMEOUT | 1 | The audio session times out.   |
513
514## AudioDataCallbackResult<sup>12+</sup>
515
516Enumerates the audio data callback results.
517
518**System capability**: SystemCapability.Multimedia.Audio.Core
519
520| Name                | Value     | Description        |
521| ---------------------| --------| ----------------- |
522| INVALID  | -1 | The callback data is invalid.     |
523| VALID      | 0 | The callback data is valid.    |
524
525## ContentType<sup>(deprecated)</sup>
526
527Enumerates the audio content types.
528
529> **NOTE**
530> This API is supported since API version 7 and deprecated since API version 10. You are advised to use [StreamUsage](#streamusage) instead.
531
532**System capability**: SystemCapability.Multimedia.Audio.Core
533
534| Name                              |  Value   | Description      |
535| ---------------------------------- | ------ | ---------- |
536| CONTENT_TYPE_UNKNOWN               | 0      | Unknown content.|
537| CONTENT_TYPE_SPEECH                | 1      | Speech.    |
538| CONTENT_TYPE_MUSIC                 | 2      | Music.    |
539| CONTENT_TYPE_MOVIE                 | 3      | Movie.    |
540| CONTENT_TYPE_SONIFICATION          | 4      | Notification tone.  |
541| CONTENT_TYPE_RINGTONE<sup>8+</sup> | 5      | Ringtone.    |
542
543## ActiveDeviceType<sup>(deprecated)</sup>
544
545Enumerates the active device types.
546
547> **NOTE**
548>
549> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [CommunicationDeviceType](#communicationdevicetype9) instead.
550
551**System capability**: SystemCapability.Multimedia.Audio.Device
552
553| Name         |  Value    | Description                                                |
554| ------------- | ------ | ---------------------------------------------------- |
555| SPEAKER       | 2      | Speaker.                                            |
556| BLUETOOTH_SCO | 7      | Bluetooth device using Synchronous Connection Oriented (SCO) links.|
557
558## InterruptActionType<sup>(deprecated)</sup>
559
560Enumerates the returned event types for audio interruption events.
561
562> **NOTE**
563>
564> This API is supported since API version 7 and deprecated since API version 9. No substitute is provided.
565
566**System capability**: SystemCapability.Multimedia.Audio.Renderer
567
568| Name          |  Value    | Description              |
569| -------------- | ------ | ------------------ |
570| TYPE_ACTIVATED | 0      | Focus gain event.|
571| TYPE_INTERRUPT | 1      | Audio interruption event.|
572
573## AudioLoopbackMode<sup>20+</sup>
574
575Enumerates the audio loopback modes.
576
577**System capability**: SystemCapability.Multimedia.Audio.Capturer
578
579| Name          | Value    | Description             |
580| -------------- | ------ | ----------------- |
581| HARDWARE       | 0      | Hardware loopback.|
582
583## AudioLoopbackStatus<sup>20+</sup>
584
585Enumerates the audio loopback statuses.
586
587**System capability**: SystemCapability.Multimedia.Audio.Capturer
588
589| Name              | Value    | Description            |
590| ------------------ | ------ | ---------------- |
591| UNAVAILABLE_DEVICE | -2     | Loopback is unavailable due to issues with the input or output device (for example, changes in the audio output device).   |
592| UNAVAILABLE_SCENE  | -1     | Loopback is unavailable due to restrictions in the audio scene (for example, audio focus or low-latency management).|
593| AVAILABLE_IDLE     |  0     | Loopback is available but currently idle.    |
594| AVAILABLE_RUNNING  |  1     | Loopback is actively running.  |
595