• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit AudioKit
19 */
20
21import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base';
22
23/**
24 * @namespace audio
25 * @since 7
26 */
27/**
28 * @namespace audio
29 * @syscap SystemCapability.Multimedia.Audio.Core
30 * @crossplatform
31 * @atomicservice
32 * @since 12
33 */
34declare namespace audio {
35  /**
36   * Enumerates audio errors.
37   * @enum { number }
38   * @syscap SystemCapability.Multimedia.Audio.Core
39   * @since 9
40   */
41  /**
42   * Enumerates audio errors.
43   * @enum { number }
44   * @syscap SystemCapability.Multimedia.Audio.Core
45   * @crossplatform
46   * @since 12
47   */
48  enum AudioErrors {
49    /**
50     * Invalid parameter.
51     * @syscap SystemCapability.Multimedia.Audio.Core
52     * @since 9
53     */
54    /**
55     * Invalid parameter.
56     * @syscap SystemCapability.Multimedia.Audio.Core
57     * @crossplatform
58     * @since 12
59     */
60    ERROR_INVALID_PARAM = 6800101,
61    /**
62     * Allocate memory failed.
63     * @syscap SystemCapability.Multimedia.Audio.Core
64     * @since 9
65     */
66    /**
67     * Allocate memory failed.
68     * @syscap SystemCapability.Multimedia.Audio.Core
69     * @crossplatform
70     * @since 12
71     */
72    ERROR_NO_MEMORY = 6800102,
73    /**
74     * Operation not permit at current state.
75     * @syscap SystemCapability.Multimedia.Audio.Core
76     * @since 9
77     */
78    /**
79     * Operation not permit at current state.
80     * @syscap SystemCapability.Multimedia.Audio.Core
81     * @crossplatform
82     * @since 12
83     */
84    ERROR_ILLEGAL_STATE = 6800103,
85    /**
86     * Unsupported option.
87     * @syscap SystemCapability.Multimedia.Audio.Core
88     * @since 9
89     */
90    /**
91     * Unsupported option.
92     * @syscap SystemCapability.Multimedia.Audio.Core
93     * @crossplatform
94     * @since 12
95     */
96    ERROR_UNSUPPORTED = 6800104,
97    /**
98     * Time out.
99     * @syscap SystemCapability.Multimedia.Audio.Core
100     * @since 9
101     */
102    ERROR_TIMEOUT = 6800105,
103    /**
104     * Audio specific errors.
105     * @syscap SystemCapability.Multimedia.Audio.Core
106     * @since 9
107     */
108    ERROR_STREAM_LIMIT = 6800201,
109    /**
110     * Default error.
111     * @syscap SystemCapability.Multimedia.Audio.Core
112     * @since 9
113     */
114    /**
115     * Default error.
116     * @syscap SystemCapability.Multimedia.Audio.Core
117     * @crossplatform
118     * @since 12
119     */
120    ERROR_SYSTEM = 6800301
121  }
122
123  /**
124   * Define local device network id for audio
125   * @syscap SystemCapability.Multimedia.Audio.Device
126   * @systemapi
127   * @since 9
128   */
129  const LOCAL_NETWORK_ID: string;
130
131  /**
132   * Define default volume group id for audio
133   * @syscap SystemCapability.Multimedia.Audio.Volume
134   * @since 9
135   */
136  /**
137   * Define default volume group id for audio
138   * @syscap SystemCapability.Multimedia.Audio.Volume
139   * @crossplatform
140   * @since 12
141   */
142  const DEFAULT_VOLUME_GROUP_ID: number;
143
144  /**
145   * Define default interrupt group id for audio
146   * @syscap SystemCapability.Multimedia.Audio.Interrupt
147   * @since 9
148   */
149  const DEFAULT_INTERRUPT_GROUP_ID: number;
150
151  /**
152   * Obtains an {@link AudioManager} instance.
153   * @returns { AudioManager } this {@link AudioManager} object.
154   * @syscap SystemCapability.Multimedia.Audio.Core
155   * @since 7
156   */
157  /**
158   * Obtains an {@link AudioManager} instance.
159   * @returns { AudioManager } this {@link AudioManager} object.
160   * @syscap SystemCapability.Multimedia.Audio.Core
161   * @crossplatform
162   * @since 12
163   */
164  function getAudioManager(): AudioManager;
165
166  /**
167   * Obtains an {@link AudioCapturer} instance.
168   * Success: This method uses an asynchronous callback to return the capturer instance.
169   * Failure: This method uses an asynchronous callback to return the error instance. Possible causes:
170   *          6800301: Parameter verification failed, Permission denied, System error;
171   *          6800101: Mandatory parameters are left unspecified, Incorrect parameter types.
172   * @param { AudioCapturerOptions } options - Capturer configurations.
173   * @param { AsyncCallback<AudioCapturer> } callback - Callback used to return the audio capturer instance.
174   * @syscap SystemCapability.Multimedia.Audio.Capturer
175   * @since 8
176   */
177  /**
178   * Obtains an {@link AudioCapturer} instance. This method uses an asynchronous callback to return the capturer instance.
179   * @param { AudioCapturerOptions } options - Capturer configurations.
180   * @param { AsyncCallback<AudioCapturer> } callback - Callback used to return the audio capturer instance.
181   * @syscap SystemCapability.Multimedia.Audio.Capturer
182   * @crossplatform
183   * @since 12
184   */
185  function createAudioCapturer(options: AudioCapturerOptions, callback: AsyncCallback<AudioCapturer>): void;
186
187  /**
188   * Obtains an {@link AudioCapturer} instance.
189   * Success: This method uses a promise to return the capturer instance.
190   * Failure: This method uses a promise to return the error instance. Possible causes:
191   *          6800301: Parameter verification failed, Permission denied, System error;
192   *          6800101: Mandatory parameters are left unspecified, Incorrect parameter types.
193   * @param { AudioCapturerOptions } options - Capturer configurations.
194   * @returns { Promise<AudioCapturer> } Promise used to return the audio capturer instance.
195   * @syscap SystemCapability.Multimedia.Audio.Capturer
196   * @since 8
197   */
198  /**
199   * Obtains an {@link AudioCapturer} instance. This method uses a promise to return the capturer instance.
200   * @param { AudioCapturerOptions } options - Capturer configurations.
201   * @returns { Promise<AudioCapturer> } Promise used to return the audio capturer instance.
202   * @syscap SystemCapability.Multimedia.Audio.Capturer
203   * @crossplatform
204   * @since 12
205   */
206  function createAudioCapturer(options: AudioCapturerOptions): Promise<AudioCapturer>;
207
208  /**
209   * Obtains an {@link AudioRenderer} instance. This method uses an asynchronous callback to return the renderer instance.
210   * @param { AudioRendererOptions } options - Renderer configurations.
211   * @param { AsyncCallback<AudioRenderer> } callback - Callback used to return the audio renderer instance.
212   * @syscap SystemCapability.Multimedia.Audio.Renderer
213   * @since 8
214   */
215  /**
216   * Obtains an {@link AudioRenderer} instance. This method uses an asynchronous callback to return the renderer instance.
217   * @param { AudioRendererOptions } options - Renderer configurations.
218   * @param { AsyncCallback<AudioRenderer> } callback - Callback used to return the audio renderer instance.
219   * @syscap SystemCapability.Multimedia.Audio.Renderer
220   * @crossplatform
221   * @since 12
222   */
223  function createAudioRenderer(options: AudioRendererOptions, callback: AsyncCallback<AudioRenderer>): void;
224
225  /**
226   * Obtains an {@link AudioRenderer} instance. This method uses a promise to return the renderer instance.
227   * @param { AudioRendererOptions } options - Renderer configurations.
228   * @returns { Promise<AudioRenderer> } Promise used to return the audio renderer instance.
229   * @syscap SystemCapability.Multimedia.Audio.Renderer
230   * @since 8
231   */
232  /**
233   * Obtains an {@link AudioRenderer} instance. This method uses a promise to return the renderer instance.
234   * @param { AudioRendererOptions } options - Renderer configurations.
235   * @returns { Promise<AudioRenderer> } Promise used to return the audio renderer instance.
236   * @syscap SystemCapability.Multimedia.Audio.Renderer
237   * @crossplatform
238   * @since 12
239   */
240  function createAudioRenderer(options: AudioRendererOptions): Promise<AudioRenderer>;
241
242  /**
243   * Obtains a {@link TonePlayer} instance. This method uses an asynchronous callback to return the renderer instance.
244   * @param { AudioRendererInfo } options - Tone playing attribute.
245   * @param { AsyncCallback<TonePlayer> } callback - Callback used to return the tonePlayer instance.
246   * @syscap SystemCapability.Multimedia.Audio.Tone
247   * @systemapi
248   * @since 9
249   */
250  function createTonePlayer(options: AudioRendererInfo, callback: AsyncCallback<TonePlayer>): void;
251
252  /**
253   * Obtains a {@link TonePlayer} instance. This method uses a promise to return the renderer instance.
254   * @param { AudioRendererInfo } options - Tone playing attribute.
255   * @returns { Promise<TonePlayer> } Promise used to return the tonePlayer instance.
256   * @syscap SystemCapability.Multimedia.Audio.Tone
257   * @systemapi
258   * @since 9
259   */
260  function createTonePlayer(options: AudioRendererInfo): Promise<TonePlayer>;
261
262  /**
263   * Enumerates the audio states.
264   * @enum { number }
265   * @syscap SystemCapability.Multimedia.Audio.Core
266   * @since 8
267   */
268  /**
269   * Enumerates the audio states.
270   * @enum { number }
271   * @syscap SystemCapability.Multimedia.Audio.Core
272   * @crossplatform
273   * @since 12
274   */
275  enum AudioState {
276    /**
277     * Invalid state.
278     * @syscap SystemCapability.Multimedia.Audio.Core
279     * @since 8
280     */
281    /**
282     * Invalid state.
283     * @syscap SystemCapability.Multimedia.Audio.Core
284     * @crossplatform
285     * @since 12
286     */
287    STATE_INVALID = -1,
288    /**
289     * Create new instance state.
290     * @syscap SystemCapability.Multimedia.Audio.Core
291     * @since 8
292     */
293    /**
294     * Create new instance state.
295     * @syscap SystemCapability.Multimedia.Audio.Core
296     * @crossplatform
297     * @since 12
298     */
299    STATE_NEW = 0,
300    /**
301     * Prepared state.
302     * @syscap SystemCapability.Multimedia.Audio.Core
303     * @since 8
304     */
305    /**
306     * Prepared state.
307     * @syscap SystemCapability.Multimedia.Audio.Core
308     * @crossplatform
309     * @since 12
310     */
311    STATE_PREPARED = 1,
312    /**
313     * Running state.
314     * @syscap SystemCapability.Multimedia.Audio.Core
315     * @since 8
316     */
317    /**
318     * Running state.
319     * @syscap SystemCapability.Multimedia.Audio.Core
320     * @crossplatform
321     * @since 12
322     */
323    STATE_RUNNING = 2,
324    /**
325     * Stopped state.
326     * @syscap SystemCapability.Multimedia.Audio.Core
327     * @since 8
328     */
329    /**
330     * Stopped state.
331     * @syscap SystemCapability.Multimedia.Audio.Core
332     * @crossplatform
333     * @since 12
334     */
335    STATE_STOPPED = 3,
336    /**
337     * Released state.
338     * @syscap SystemCapability.Multimedia.Audio.Core
339     * @since 8
340     */
341    /**
342     * Released state.
343     * @syscap SystemCapability.Multimedia.Audio.Core
344     * @crossplatform
345     * @since 12
346     */
347    STATE_RELEASED = 4,
348    /**
349     * Paused state.
350     * @syscap SystemCapability.Multimedia.Audio.Core
351     * @since 8
352     */
353    /**
354     * Paused state.
355     * @syscap SystemCapability.Multimedia.Audio.Core
356     * @crossplatform
357     * @since 12
358     */
359    STATE_PAUSED = 5
360  }
361
362  /**
363   * Enumerates audio stream types.
364   * @enum { number }
365   * @syscap SystemCapability.Multimedia.Audio.Volume
366   * @since 7
367   */
368  /**
369   * Enumerates audio stream types.
370   * @enum { number }
371   * @syscap SystemCapability.Multimedia.Audio.Volume
372   * @crossplatform
373   * @since 12
374   */
375  enum AudioVolumeType {
376    /**
377     * Audio streams for voice calls.
378     * @syscap SystemCapability.Multimedia.Audio.Volume
379     * @since 8
380     */
381    /**
382     * Audio streams for voice calls.
383     * @syscap SystemCapability.Multimedia.Audio.Volume
384     * @crossplatform
385     * @since 12
386     */
387    VOICE_CALL = 0,
388    /**
389     * Audio streams for ringtones.
390     * @syscap SystemCapability.Multimedia.Audio.Volume
391     * @since 7
392     */
393    /**
394     * Audio streams for ringtones.
395     * @syscap SystemCapability.Multimedia.Audio.Volume
396     * @crossplatform
397     * @since 12
398     */
399    RINGTONE = 2,
400    /**
401     * Audio streams for media purpose.
402     * @syscap SystemCapability.Multimedia.Audio.Volume
403     * @since 7
404     */
405    /**
406     * Audio streams for media purpose.
407     * @syscap SystemCapability.Multimedia.Audio.Volume
408     * @crossplatform
409     * @since 12
410     */
411    MEDIA = 3,
412    /**
413     * Audio volume for alarm purpose.
414     * @syscap SystemCapability.Multimedia.Audio.Volume
415     * @since 10
416     */
417    /**
418     * Audio volume for alarm purpose.
419     * @syscap SystemCapability.Multimedia.Audio.Volume
420     * @crossplatform
421     * @since 12
422     */
423    ALARM = 4,
424    /**
425     * Audio volume for accessibility purpose.
426     * @syscap SystemCapability.Multimedia.Audio.Volume
427     * @since 10
428     */
429    /**
430     * Audio volume for accessibility purpose.
431     * @syscap SystemCapability.Multimedia.Audio.Volume
432     * @crossplatform
433     * @since 12
434     */
435    ACCESSIBILITY = 5,
436    /**
437     * Audio stream for voice assistant.
438     * @syscap SystemCapability.Multimedia.Audio.Volume
439     * @since 8
440     */
441    VOICE_ASSISTANT = 9,
442    /**
443     * Audio volume for ultrasonic.
444     * @syscap SystemCapability.Multimedia.Audio.Volume
445     * @systemapi
446     * @since 10
447     */
448    ULTRASONIC = 10,
449    /**
450     * Audio stream for all common.
451     * @syscap SystemCapability.Multimedia.Audio.Volume
452     * @systemapi
453     * @since 9
454     */
455    ALL = 100,
456  }
457
458  /**
459   * Enumerates audio device flags.
460   * @enum { number }
461   * @syscap SystemCapability.Multimedia.Audio.Device
462   * @since 7
463   */
464  /**
465   * Enumerates audio device flags.
466   * @enum { number }
467   * @syscap SystemCapability.Multimedia.Audio.Device
468   * @crossplatform
469   * @since 12
470   */
471  enum DeviceFlag {
472    /**
473     * None devices.
474     * @syscap SystemCapability.Multimedia.Audio.Device
475     * @systemapi
476     * @since 9
477     */
478    NONE_DEVICES_FLAG = 0,
479    /**
480     * Output devices.
481     * @syscap SystemCapability.Multimedia.Audio.Device
482     * @since 7
483     */
484    /**
485     * Output devices.
486     * @syscap SystemCapability.Multimedia.Audio.Device
487     * @crossplatform
488     * @since 12
489     */
490    OUTPUT_DEVICES_FLAG = 1,
491    /**
492     * Input devices.
493     * @syscap SystemCapability.Multimedia.Audio.Device
494     * @since 7
495     */
496    /**
497     * Input devices.
498     * @syscap SystemCapability.Multimedia.Audio.Device
499     * @crossplatform
500     * @since 12
501     */
502    INPUT_DEVICES_FLAG = 2,
503    /**
504     * All devices.
505     * @syscap SystemCapability.Multimedia.Audio.Device
506     * @since 7
507     */
508    /**
509     * All devices.
510     * @syscap SystemCapability.Multimedia.Audio.Device
511     * @crossplatform
512     * @since 12
513     */
514    ALL_DEVICES_FLAG = 3,
515    /**
516     * Distributed output devices.
517     * @syscap SystemCapability.Multimedia.Audio.Device
518     * @systemapi
519     * @since 9
520     */
521    DISTRIBUTED_OUTPUT_DEVICES_FLAG = 4,
522    /**
523     * Distributed input devices.
524     * @syscap SystemCapability.Multimedia.Audio.Device
525     * @systemapi
526     * @since 9
527     */
528    DISTRIBUTED_INPUT_DEVICES_FLAG = 8,
529    /**
530     * All Distributed devices.
531     * @syscap SystemCapability.Multimedia.Audio.Device
532     * @systemapi
533     * @since 9
534     */
535    ALL_DISTRIBUTED_DEVICES_FLAG = 12,
536  }
537
538  /**
539   * Enumerates audio device for usage.
540   * @enum { number }
541   * @syscap SystemCapability.Multimedia.Audio.Device
542   * @since 12
543   */
544  enum DeviceUsage {
545    /**
546     * Media output devices.
547     * @syscap SystemCapability.Multimedia.Audio.Device
548     * @since 12
549     */
550    MEDIA_OUTPUT_DEVICES = 1,
551    /**
552     * Media input devices.
553     * @syscap SystemCapability.Multimedia.Audio.Device
554     * @since 12
555     */
556    MEDIA_INPUT_DEVICES = 2,
557    /**
558     * All media devices.
559     * @syscap SystemCapability.Multimedia.Audio.Device
560     * @since 12
561     */
562    ALL_MEDIA_DEVICES = 3,
563    /**
564     * Call output devices.
565     * @syscap SystemCapability.Multimedia.Audio.Device
566     * @since 12
567     */
568    CALL_OUTPUT_DEVICES = 4,
569    /**
570     * Call input devices.
571     * @syscap SystemCapability.Multimedia.Audio.Device
572     * @since 12
573     */
574    CALL_INPUT_DEVICES = 8,
575    /**
576     * All call devices.
577     * @syscap SystemCapability.Multimedia.Audio.Device
578     * @since 12
579     */
580    ALL_CALL_DEVICES = 12,
581  }
582
583  /**
584   * Enumerates device roles.
585   * @enum { number }
586   * @syscap SystemCapability.Multimedia.Audio.Device
587   * @since 7
588   */
589  /**
590   * Enumerates device roles.
591   * @enum { number }
592   * @syscap SystemCapability.Multimedia.Audio.Device
593   * @crossplatform
594   * @atomicservice
595   * @since 12
596   */
597  enum DeviceRole {
598    /**
599     * Input role.
600     * @syscap SystemCapability.Multimedia.Audio.Device
601     * @since 7
602     */
603    /**
604     * Input role.
605     * @syscap SystemCapability.Multimedia.Audio.Device
606     * @crossplatform
607     * @atomicservice
608     * @since 12
609     */
610    INPUT_DEVICE = 1,
611    /**
612     * Output role.
613     * @syscap SystemCapability.Multimedia.Audio.Device
614     * @since 7
615     */
616    /**
617     * Output role.
618     * @syscap SystemCapability.Multimedia.Audio.Device
619     * @crossplatform
620     * @atomicservice
621     * @since 12
622     */
623    OUTPUT_DEVICE = 2,
624  }
625
626  /**
627   * Enumerates device types.
628   * @enum { number }
629   * @syscap SystemCapability.Multimedia.Audio.Device
630   * @since 7
631   */
632  /**
633   * Enumerates device types.
634   * @enum { number }
635   * @syscap SystemCapability.Multimedia.Audio.Device
636   * @crossplatform
637   * @atomicservice
638   * @since 12
639   */
640  enum DeviceType {
641    /**
642     * Invalid device.
643     * @syscap SystemCapability.Multimedia.Audio.Device
644     * @since 7
645     */
646    /**
647     * Invalid device.
648     * @syscap SystemCapability.Multimedia.Audio.Device
649     * @crossplatform
650     * @atomicservice
651     * @since 12
652     */
653    INVALID = 0,
654    /**
655     * Built-in earpiece.
656     * @syscap SystemCapability.Multimedia.Audio.Device
657     * @since 7
658     */
659    /**
660     * Built-in earpiece.
661     * @syscap SystemCapability.Multimedia.Audio.Device
662     * @crossplatform
663     * @atomicservice
664     * @since 12
665     */
666    EARPIECE = 1,
667    /**
668     * Built-in speaker.
669     * @syscap SystemCapability.Multimedia.Audio.Device
670     * @since 7
671     */
672    /**
673     * Built-in speaker.
674     * @syscap SystemCapability.Multimedia.Audio.Device
675     * @crossplatform
676     * @atomicservice
677     * @since 12
678     */
679    SPEAKER = 2,
680    /**
681     * Wired headset, which is a combination of a pair of earpieces and a microphone.
682     * @syscap SystemCapability.Multimedia.Audio.Device
683     * @since 7
684     */
685    /**
686     * Wired headset, which is a combination of a pair of earpieces and a microphone.
687     * @syscap SystemCapability.Multimedia.Audio.Device
688     * @crossplatform
689     * @atomicservice
690     * @since 12
691     */
692    WIRED_HEADSET = 3,
693    /**
694     * A pair of wired headphones.
695     * @syscap SystemCapability.Multimedia.Audio.Device
696     * @since 7
697     */
698    /**
699     * A pair of wired headphones.
700     * @syscap SystemCapability.Multimedia.Audio.Device
701     * @crossplatform
702     * @atomicservice
703     * @since 12
704     */
705    WIRED_HEADPHONES = 4,
706    /**
707     * Bluetooth device using the synchronous connection oriented link (SCO).
708     * @syscap SystemCapability.Multimedia.Audio.Device
709     * @since 7
710     */
711    /**
712     * Bluetooth device using the synchronous connection oriented link (SCO).
713     * @syscap SystemCapability.Multimedia.Audio.Device
714     * @crossplatform
715     * @atomicservice
716     * @since 12
717     */
718    BLUETOOTH_SCO = 7,
719    /**
720     * Bluetooth device using advanced audio distribution profile (A2DP).
721     * @syscap SystemCapability.Multimedia.Audio.Device
722     * @since 7
723     */
724    /**
725     * Bluetooth device using advanced audio distribution profile (A2DP).
726     * @syscap SystemCapability.Multimedia.Audio.Device
727     * @crossplatform
728     * @atomicservice
729     * @since 12
730     */
731    BLUETOOTH_A2DP = 8,
732    /**
733     * Built-in microphone.
734     * @syscap SystemCapability.Multimedia.Audio.Device
735     * @since 7
736     */
737    /**
738     * Built-in microphone.
739     * @syscap SystemCapability.Multimedia.Audio.Device
740     * @crossplatform
741     * @atomicservice
742     * @since 12
743     */
744    MIC = 15,
745    /**
746     * USB audio headset.
747     * @syscap SystemCapability.Multimedia.Audio.Device
748     * @since 7
749     */
750    /**
751     * USB audio headset.
752     * @syscap SystemCapability.Multimedia.Audio.Device
753     * @crossplatform
754     * @atomicservice
755     * @since 12
756     */
757    USB_HEADSET = 22,
758    /**
759     * Display port device.
760     * @syscap SystemCapability.Multimedia.Audio.Device
761     * @atomicservice
762     * @since 12
763     */
764    DISPLAY_PORT = 23,
765    /**
766     * Device type for rerouting audio to other remote devices by system application
767     * @syscap SystemCapability.Multimedia.Audio.Device
768     * @atomicservice
769     * @since 12
770     */
771    REMOTE_CAST = 24,
772    /**
773     * Default device type.
774     * @syscap SystemCapability.Multimedia.Audio.Device
775     * @since 9
776     */
777    /**
778     * Default device type.
779     * @syscap SystemCapability.Multimedia.Audio.Device
780     * @crossplatform
781     * @atomicservice
782     * @since 12
783     */
784    DEFAULT = 1000,
785  }
786
787  /**
788   * Enumerates the active device types.
789   * @enum { number }
790   * @syscap SystemCapability.Multimedia.Audio.Device
791   * @since 7
792   * @deprecated since 9
793   * @useinstead ohos.multimedia.audio.CommunicationDeviceType
794   */
795  enum ActiveDeviceType {
796    /**
797     * Speaker.
798     * @syscap SystemCapability.Multimedia.Audio.Device
799     * @since 7
800     * @deprecated since 9
801     * @useinstead ohos.multimedia.audio.CommunicationDeviceType.SPEAKER
802     */
803    SPEAKER = 2,
804    /**
805     * Bluetooth device using the SCO link.
806     * @syscap SystemCapability.Multimedia.Audio.Device
807     * @since 7
808     * @deprecated since 9
809     */
810    BLUETOOTH_SCO = 7,
811  }
812
813  /**
814   * Enumerates the available device types for communication.
815   * @enum { number }
816   * @syscap SystemCapability.Multimedia.Audio.Communication
817   * @since 9
818   */
819  /**
820   * Enumerates the available device types for communication.
821   * @enum { number }
822   * @syscap SystemCapability.Multimedia.Audio.Communication
823   * @crossplatform
824   * @since 12
825   */
826  enum CommunicationDeviceType {
827    /**
828     * Speaker.
829     * @syscap SystemCapability.Multimedia.Audio.Communication
830     * @since 9
831     */
832    /**
833     * Speaker.
834     * @syscap SystemCapability.Multimedia.Audio.Communication
835     * @crossplatform
836     * @since 12
837     */
838    SPEAKER = 2
839  }
840
841  /**
842   * Enumerates ringer modes.
843   * @enum { number }
844   * @syscap SystemCapability.Multimedia.Audio.Communication
845   * @since 7
846   */
847  /**
848   * Enumerates ringer modes.
849   * @enum { number }
850   * @syscap SystemCapability.Multimedia.Audio.Communication
851   * @crossplatform
852   * @since 12
853   */
854  enum AudioRingMode {
855    /**
856     * Silent mode.
857     * @syscap SystemCapability.Multimedia.Audio.Communication
858     * @since 7
859     */
860    /**
861     * Silent mode.
862     * @syscap SystemCapability.Multimedia.Audio.Communication
863     * @crossplatform
864     * @since 12
865     */
866    RINGER_MODE_SILENT = 0,
867    /**
868     * Vibration mode.
869     * @syscap SystemCapability.Multimedia.Audio.Communication
870     * @since 7
871     */
872    /**
873     * Vibration mode.
874     * @syscap SystemCapability.Multimedia.Audio.Communication
875     * @crossplatform
876     * @since 12
877     */
878    RINGER_MODE_VIBRATE = 1,
879    /**
880     * Normal mode.
881     * @syscap SystemCapability.Multimedia.Audio.Communication
882     * @since 7
883     */
884    /**
885     * Normal mode.
886     * @syscap SystemCapability.Multimedia.Audio.Communication
887     * @crossplatform
888     * @since 12
889     */
890    RINGER_MODE_NORMAL = 2,
891  }
892
893  /**
894   * Enumerates type.
895   * @enum { number }
896   * @syscap SystemCapability.Multimedia.Audio.Volume
897   * @systemapi
898   * @since 12
899   */
900  enum PolicyType {
901    /**
902     * EDM type.
903     * @syscap SystemCapability.Multimedia.Audio.Volume
904     * @systemapi
905     * @since 12
906     */
907    EDM = 0,
908    /**
909     * PRIVACY type.
910     * @syscap SystemCapability.Multimedia.Audio.Volume
911     * @systemapi
912     * @since 12
913     */
914    PRIVACY = 1,
915  }
916
917  /**
918   * Enumerates the audio sample formats.
919   * @enum { number }
920   * @syscap SystemCapability.Multimedia.Audio.Core
921   * @since 8
922   */
923  /**
924   * Enumerates the audio sample formats.
925   * @enum { number }
926   * @syscap SystemCapability.Multimedia.Audio.Core
927   * @crossplatform
928   * @since 12
929   */
930  enum AudioSampleFormat {
931    /**
932     * Invalid format.
933     * @syscap SystemCapability.Multimedia.Audio.Core
934     * @since 8
935     */
936    /**
937     * Invalid format.
938     * @syscap SystemCapability.Multimedia.Audio.Core
939     * @crossplatform
940     * @since 12
941     */
942    SAMPLE_FORMAT_INVALID = -1,
943    /**
944     * Unsigned 8 format.
945     * @syscap SystemCapability.Multimedia.Audio.Core
946     * @since 8
947     */
948    /**
949     * Unsigned 8 format.
950     * @syscap SystemCapability.Multimedia.Audio.Core
951     * @crossplatform
952     * @since 12
953     */
954    SAMPLE_FORMAT_U8 = 0,
955    /**
956     * Signed 16 bit integer, little endian.
957     * @syscap SystemCapability.Multimedia.Audio.Core
958     * @since 8
959     */
960    /**
961     * Signed 16 bit integer, little endian.
962     * @syscap SystemCapability.Multimedia.Audio.Core
963     * @crossplatform
964     * @since 12
965     */
966    SAMPLE_FORMAT_S16LE = 1,
967    /**
968     * Signed 24 bit integer, little endian.
969     * @syscap SystemCapability.Multimedia.Audio.Core
970     * @since 8
971     */
972    /**
973     * Signed 24 bit integer, little endian.
974     * @syscap SystemCapability.Multimedia.Audio.Core
975     * @crossplatform
976     * @since 12
977     */
978    SAMPLE_FORMAT_S24LE = 2,
979    /**
980     * Signed 32 bit integer, little endian.
981     * @syscap SystemCapability.Multimedia.Audio.Core
982     * @since 8
983     */
984    /**
985     * Signed 32 bit integer, little endian.
986     * @syscap SystemCapability.Multimedia.Audio.Core
987     * @crossplatform
988     * @since 12
989     */
990    SAMPLE_FORMAT_S32LE = 3,
991    /**
992     * Signed 32 bit float, little endian.
993     * @syscap SystemCapability.Multimedia.Audio.Core
994     * @since 9
995     */
996    /**
997     * Signed 32 bit float, little endian.
998     * @syscap SystemCapability.Multimedia.Audio.Core
999     * @crossplatform
1000     * @since 12
1001     */
1002    SAMPLE_FORMAT_F32LE = 4,
1003  }
1004
1005  /**
1006   * Enumerates the audio channel.
1007   * @enum { number }
1008   * @syscap SystemCapability.Multimedia.Audio.Core
1009   * @since 8
1010   */
1011  /**
1012   * Enumerates the audio channel.
1013   * @enum { number }
1014   * @syscap SystemCapability.Multimedia.Audio.Core
1015   * @crossplatform
1016   * @since 12
1017   */
1018  enum AudioChannel {
1019    /**
1020     * Channel 1.
1021     * @syscap SystemCapability.Multimedia.Audio.Core
1022     * @since 8
1023     */
1024    /**
1025     * Channel 1.
1026     * @syscap SystemCapability.Multimedia.Audio.Core
1027     * @crossplatform
1028     * @since 12
1029     */
1030    CHANNEL_1 = 0x1 << 0,
1031    /**
1032     * Channel 2.
1033     * @syscap SystemCapability.Multimedia.Audio.Core
1034     * @since 8
1035     */
1036    /**
1037     * Channel 2.
1038     * @syscap SystemCapability.Multimedia.Audio.Core
1039     * @crossplatform
1040     * @since 12
1041     */
1042    CHANNEL_2 = 0x1 << 1,
1043    /**
1044     * Channel 3.
1045     * @syscap SystemCapability.Multimedia.Audio.Core
1046     * @since 11
1047     */
1048    /**
1049     * Channel 3.
1050     * @syscap SystemCapability.Multimedia.Audio.Core
1051     * @crossplatform
1052     * @since 12
1053     */
1054    CHANNEL_3 = 3,
1055    /**
1056     * Channel 4.
1057     * @syscap SystemCapability.Multimedia.Audio.Core
1058     * @since 11
1059     */
1060    /**
1061     * Channel 4.
1062     * @syscap SystemCapability.Multimedia.Audio.Core
1063     * @crossplatform
1064     * @since 12
1065     */
1066    CHANNEL_4 = 4,
1067    /**
1068     * Channel 5.
1069     * @syscap SystemCapability.Multimedia.Audio.Core
1070     * @since 11
1071     */
1072    /**
1073     * Channel 5.
1074     * @syscap SystemCapability.Multimedia.Audio.Core
1075     * @crossplatform
1076     * @since 12
1077     */
1078    CHANNEL_5 = 5,
1079    /**
1080     * Channel 6.
1081     * @syscap SystemCapability.Multimedia.Audio.Core
1082     * @since 11
1083     */
1084    /**
1085     * Channel 6.
1086     * @syscap SystemCapability.Multimedia.Audio.Core
1087     * @crossplatform
1088     * @since 12
1089     */
1090    CHANNEL_6 = 6,
1091    /**
1092     * Channel 7.
1093     * @syscap SystemCapability.Multimedia.Audio.Core
1094     * @since 11
1095     */
1096    /**
1097     * Channel 7.
1098     * @syscap SystemCapability.Multimedia.Audio.Core
1099     * @crossplatform
1100     * @since 12
1101     */
1102    CHANNEL_7 = 7,
1103    /**
1104     * Channel 8.
1105     * @syscap SystemCapability.Multimedia.Audio.Core
1106     * @since 11
1107     */
1108    /**
1109     * Channel 8.
1110     * @syscap SystemCapability.Multimedia.Audio.Core
1111     * @crossplatform
1112     * @since 12
1113     */
1114    CHANNEL_8 = 8,
1115    /**
1116     * Channel 9.
1117     * @syscap SystemCapability.Multimedia.Audio.Core
1118     * @since 11
1119     */
1120    /**
1121     * Channel 9.
1122     * @syscap SystemCapability.Multimedia.Audio.Core
1123     * @crossplatform
1124     * @since 12
1125     */
1126    CHANNEL_9 = 9,
1127    /**
1128     * Channel 10.
1129     * @syscap SystemCapability.Multimedia.Audio.Core
1130     * @since 11
1131     */
1132    /**
1133     * Channel 10.
1134     * @syscap SystemCapability.Multimedia.Audio.Core
1135     * @crossplatform
1136     * @since 12
1137     */
1138    CHANNEL_10 = 10,
1139    /**
1140     * Channel 12.
1141     * @syscap SystemCapability.Multimedia.Audio.Core
1142     * @since 11
1143     */
1144    /**
1145     * Channel 12.
1146     * @syscap SystemCapability.Multimedia.Audio.Core
1147     * @crossplatform
1148     * @since 12
1149     */
1150    CHANNEL_12 = 12,
1151    /**
1152     * Channel 14.
1153     * @syscap SystemCapability.Multimedia.Audio.Core
1154     * @since 11
1155     */
1156    /**
1157     * Channel 14.
1158     * @syscap SystemCapability.Multimedia.Audio.Core
1159     * @crossplatform
1160     * @since 12
1161     */
1162    CHANNEL_14 = 14,
1163    /**
1164     * Channel 16.
1165     * @syscap SystemCapability.Multimedia.Audio.Core
1166     * @since 11
1167     */
1168    /**
1169     * Channel 16.
1170     * @syscap SystemCapability.Multimedia.Audio.Core
1171     * @crossplatform
1172     * @since 12
1173     */
1174    CHANNEL_16 = 16
1175  }
1176
1177  /**
1178   * Enumerates the audio sampling rate.
1179   * @enum { number }
1180   * @syscap SystemCapability.Multimedia.Audio.Core
1181   * @since 8
1182   */
1183  /**
1184   * Enumerates the audio sampling rate.
1185   * @enum { number }
1186   * @syscap SystemCapability.Multimedia.Audio.Core
1187   * @crossplatform
1188   * @since 12
1189   */
1190  enum AudioSamplingRate {
1191    /**
1192     * 8kHz sample rate.
1193     * @syscap SystemCapability.Multimedia.Audio.Core
1194     * @since 8
1195     */
1196    /**
1197     * 8kHz sample rate.
1198     * @syscap SystemCapability.Multimedia.Audio.Core
1199     * @crossplatform
1200     * @since 12
1201     */
1202    SAMPLE_RATE_8000 = 8000,
1203    /**
1204     * 11.025kHz sample rate.
1205     * @syscap SystemCapability.Multimedia.Audio.Core
1206     * @since 8
1207     */
1208    /**
1209     * 11.025kHz sample rate.
1210     * @syscap SystemCapability.Multimedia.Audio.Core
1211     * @crossplatform
1212     * @since 12
1213     */
1214    SAMPLE_RATE_11025 = 11025,
1215    /**
1216     * 12kHz sample rate.
1217     * @syscap SystemCapability.Multimedia.Audio.Core
1218     * @since 8
1219     */
1220    /**
1221     * 12kHz sample rate.
1222     * @syscap SystemCapability.Multimedia.Audio.Core
1223     * @crossplatform
1224     * @since 12
1225     */
1226    SAMPLE_RATE_12000 = 12000,
1227    /**
1228     * 16kHz sample rate.
1229     * @syscap SystemCapability.Multimedia.Audio.Core
1230     * @since 8
1231     */
1232    /**
1233     * 16kHz sample rate.
1234     * @syscap SystemCapability.Multimedia.Audio.Core
1235     * @crossplatform
1236     * @since 12
1237     */
1238    SAMPLE_RATE_16000 = 16000,
1239    /**
1240     * 22.05kHz sample rate.
1241     * @syscap SystemCapability.Multimedia.Audio.Core
1242     * @since 8
1243     */
1244    /**
1245     * 22.05kHz sample rate.
1246     * @syscap SystemCapability.Multimedia.Audio.Core
1247     * @crossplatform
1248     * @since 12
1249     */
1250    SAMPLE_RATE_22050 = 22050,
1251    /**
1252     * 24kHz sample rate.
1253     * @syscap SystemCapability.Multimedia.Audio.Core
1254     * @since 8
1255     */
1256    /**
1257     * 24kHz sample rate.
1258     * @syscap SystemCapability.Multimedia.Audio.Core
1259     * @crossplatform
1260     * @since 12
1261     */
1262    SAMPLE_RATE_24000 = 24000,
1263    /**
1264     * 32kHz sample rate.
1265     * @syscap SystemCapability.Multimedia.Audio.Core
1266     * @since 8
1267     */
1268    /**
1269     * 32kHz sample rate.
1270     * @syscap SystemCapability.Multimedia.Audio.Core
1271     * @crossplatform
1272     * @since 12
1273     */
1274    SAMPLE_RATE_32000 = 32000,
1275    /**
1276     * 44.1kHz sample rate.
1277     * @syscap SystemCapability.Multimedia.Audio.Core
1278     * @since 8
1279     */
1280    /**
1281     * 44.1kHz sample rate.
1282     * @syscap SystemCapability.Multimedia.Audio.Core
1283     * @crossplatform
1284     * @since 12
1285     */
1286    SAMPLE_RATE_44100 = 44100,
1287    /**
1288     * 48kHz sample rate.
1289     * @syscap SystemCapability.Multimedia.Audio.Core
1290     * @since 8
1291     */
1292    /**
1293     * 48kHz sample rate.
1294     * @syscap SystemCapability.Multimedia.Audio.Core
1295     * @crossplatform
1296     * @since 12
1297     */
1298    SAMPLE_RATE_48000 = 48000,
1299    /**
1300     * 64kHz sample rate.
1301     * @syscap SystemCapability.Multimedia.Audio.Core
1302     * @since 8
1303     */
1304    /**
1305     * 64kHz sample rate.
1306     * @syscap SystemCapability.Multimedia.Audio.Core
1307     * @crossplatform
1308     * @since 12
1309     */
1310    SAMPLE_RATE_64000 = 64000,
1311    /**
1312     * 88.2kHz sample rate.
1313     * @syscap SystemCapability.Multimedia.Audio.Core
1314     * @since 12
1315     */
1316    SAMPLE_RATE_88200 = 88200,
1317    /**
1318     * 96kHz sample rate.
1319     * @syscap SystemCapability.Multimedia.Audio.Core
1320     * @since 8
1321     */
1322    /**
1323     * 96kHz sample rate.
1324     * @syscap SystemCapability.Multimedia.Audio.Core
1325     * @crossplatform
1326     * @since 12
1327     */
1328    SAMPLE_RATE_96000 = 96000,
1329    /**
1330     * 176.4kHz sample rate.
1331     * @syscap SystemCapability.Multimedia.Audio.Core
1332     * @since 12
1333     */
1334    SAMPLE_RATE_176400 = 176400,
1335    /**
1336     * 192kHz sample rate.
1337     * @syscap SystemCapability.Multimedia.Audio.Core
1338     * @since 12
1339     */
1340    SAMPLE_RATE_192000 = 192000
1341  }
1342
1343  /**
1344   * Enumerates the audio encoding type.
1345   * @enum { number }
1346   * @syscap SystemCapability.Multimedia.Audio.Core
1347   * @since 8
1348   */
1349  /**
1350   * Enumerates the audio encoding type.
1351   * @enum { number }
1352   * @syscap SystemCapability.Multimedia.Audio.Core
1353   * @crossplatform
1354   * @atomicservice
1355   * @since 12
1356   */
1357  enum AudioEncodingType {
1358    /**
1359     * Invalid type.
1360     * @syscap SystemCapability.Multimedia.Audio.Core
1361     * @since 8
1362     */
1363    /**
1364     * Invalid type.
1365     * @syscap SystemCapability.Multimedia.Audio.Core
1366     * @crossplatform
1367     * @atomicservice
1368     * @since 12
1369     */
1370    ENCODING_TYPE_INVALID = -1,
1371    /**
1372     * PCM encoding.
1373     * @syscap SystemCapability.Multimedia.Audio.Core
1374     * @since 8
1375     */
1376    /**
1377     * PCM encoding.
1378     * @syscap SystemCapability.Multimedia.Audio.Core
1379     * @crossplatform
1380     * @atomicservice
1381     * @since 12
1382     */
1383    ENCODING_TYPE_RAW = 0
1384  }
1385
1386  /**
1387   * Enumerates the audio content type.
1388   * @enum { number }
1389   * @syscap SystemCapability.Multimedia.Audio.Core
1390   * @since 7
1391   * @deprecated since 10
1392   * @useinstead ohos.multimedia.audio.StreamUsage
1393   */
1394  enum ContentType {
1395    /**
1396     * Unknown content.
1397     * @syscap SystemCapability.Multimedia.Audio.Core
1398     * @since 7
1399     * @deprecated since 10
1400     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_UNKNOWN
1401     */
1402    CONTENT_TYPE_UNKNOWN = 0,
1403    /**
1404     * Speech content.
1405     * @syscap SystemCapability.Multimedia.Audio.Core
1406     * @since 7
1407     * @deprecated since 10
1408     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_VOICE_COMMUNICATION
1409     */
1410    CONTENT_TYPE_SPEECH = 1,
1411    /**
1412     * Music content.
1413     * @syscap SystemCapability.Multimedia.Audio.Core
1414     * @since 7
1415     * @deprecated since 10
1416     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_MUSIC
1417     */
1418    CONTENT_TYPE_MUSIC = 2,
1419    /**
1420     * Movie content.
1421     * @syscap SystemCapability.Multimedia.Audio.Core
1422     * @since 7
1423     * @deprecated since 10
1424     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_MOVIE
1425     */
1426    CONTENT_TYPE_MOVIE = 3,
1427    /**
1428     * Notification content.
1429     * @syscap SystemCapability.Multimedia.Audio.Core
1430     * @since 7
1431     * @deprecated since 10
1432     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_NOTIFICATION
1433     */
1434    CONTENT_TYPE_SONIFICATION = 4,
1435    /**
1436     * Ringtone content.
1437     * @syscap SystemCapability.Multimedia.Audio.Core
1438     * @since 8
1439     * @deprecated since 10
1440     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_RINGTONE
1441     */
1442    CONTENT_TYPE_RINGTONE = 5,
1443  }
1444
1445  /**
1446   * Enumerates the stream usage.
1447   * @enum { number }
1448   * @syscap SystemCapability.Multimedia.Audio.Core
1449   * @since 7
1450   */
1451  /**
1452   * Enumerates the stream usage.
1453   * @enum { number }
1454   * @syscap SystemCapability.Multimedia.Audio.Core
1455   * @crossplatform
1456   * @atomicservice
1457   * @since 12
1458   */
1459  enum StreamUsage {
1460    /**
1461     * Unknown usage.
1462     * @syscap SystemCapability.Multimedia.Audio.Core
1463     * @since 7
1464     */
1465    /**
1466     * Unknown usage.
1467     * @syscap SystemCapability.Multimedia.Audio.Core
1468     * @crossplatform
1469     * @atomicservice
1470     * @since 12
1471     */
1472    STREAM_USAGE_UNKNOWN = 0,
1473    /**
1474     * Media usage.
1475     * @syscap SystemCapability.Multimedia.Audio.Core
1476     * @since 7
1477     * @deprecated since 10
1478     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_MUSIC or
1479     *             ohos.multimedia.audio.StreamUsage.STREAM_USAGE_MOVIE or
1480     *             ohos.multimedia.audio.StreamUsage.STREAM_USAGE_GAME or
1481     *             ohos.multimedia.audio.StreamUsage.STREAM_USAGE_AUDIOBOOK
1482     */
1483    STREAM_USAGE_MEDIA = 1,
1484    /**
1485     * Music usage.
1486     * @syscap SystemCapability.Multimedia.Audio.Core
1487     * @since 10
1488     */
1489    /**
1490     * Music usage.
1491     * @syscap SystemCapability.Multimedia.Audio.Core
1492     * @crossplatform
1493     * @atomicservice
1494     * @since 12
1495     */
1496    STREAM_USAGE_MUSIC = 1,
1497    /**
1498     * Voice communication usage.
1499     * @syscap SystemCapability.Multimedia.Audio.Core
1500     * @since 7
1501     */
1502    /**
1503     * Voice communication usage.
1504     * @syscap SystemCapability.Multimedia.Audio.Core
1505     * @crossplatform
1506     * @atomicservice
1507     * @since 12
1508     */
1509    STREAM_USAGE_VOICE_COMMUNICATION = 2,
1510    /**
1511     * Voice assistant broadcast usage.
1512     * @syscap SystemCapability.Multimedia.Audio.Core
1513     * @since 9
1514     */
1515    /**
1516     * Voice assistant broadcast usage.
1517     * @syscap SystemCapability.Multimedia.Audio.Core
1518     * @crossplatform
1519     * @atomicservice
1520     * @since 12
1521     */
1522    STREAM_USAGE_VOICE_ASSISTANT = 3,
1523    /**
1524     * Alarm usage.
1525     * @syscap SystemCapability.Multimedia.Audio.Core
1526     * @since 10
1527     */
1528    /**
1529     * Alarm usage.
1530     * @syscap SystemCapability.Multimedia.Audio.Core
1531     * @crossplatform
1532     * @atomicservice
1533     * @since 12
1534     */
1535    STREAM_USAGE_ALARM = 4,
1536    /**
1537     * Voice message usage.
1538     * @syscap SystemCapability.Multimedia.Audio.Core
1539     * @since 10
1540     */
1541    /**
1542     * Voice message usage.
1543     * @syscap SystemCapability.Multimedia.Audio.Core
1544     * @atomicservice
1545     * @since 12
1546     */
1547    STREAM_USAGE_VOICE_MESSAGE = 5,
1548    /**
1549     * Notification or ringtone usage.
1550     * @syscap SystemCapability.Multimedia.Audio.Core
1551     * @since 7
1552     * @deprecated since 10
1553     * @useinstead ohos.multimedia.audio.StreamUsage.STREAM_USAGE_RINGTONE
1554     */
1555    STREAM_USAGE_NOTIFICATION_RINGTONE = 6,
1556    /**
1557     * Ringtone usage.
1558     * @syscap SystemCapability.Multimedia.Audio.Core
1559     * @since 10
1560     */
1561    /**
1562     * Ringtone usage.
1563     * @syscap SystemCapability.Multimedia.Audio.Core
1564     * @crossplatform
1565     * @atomicservice
1566     * @since 12
1567     */
1568    STREAM_USAGE_RINGTONE = 6,
1569    /**
1570     * Notification usage.
1571     * @syscap SystemCapability.Multimedia.Audio.Core
1572     * @since 10
1573     */
1574    /**
1575     * Notification usage.
1576     * @syscap SystemCapability.Multimedia.Audio.Core
1577     * @crossplatform
1578     * @atomicservice
1579     * @since 12
1580     */
1581    STREAM_USAGE_NOTIFICATION = 7,
1582    /**
1583     * Accessibility usage, such as screen reader.
1584     * @syscap SystemCapability.Multimedia.Audio.Core
1585     * @since 10
1586     */
1587    /**
1588     * Accessibility usage, such as screen reader.
1589     * @syscap SystemCapability.Multimedia.Audio.Core
1590     * @crossplatform
1591     * @atomicservice
1592     * @since 12
1593     */
1594    STREAM_USAGE_ACCESSIBILITY = 8,
1595    /**
1596     * System usage, such as screen lock or key click.
1597     * @syscap SystemCapability.Multimedia.Audio.Core
1598     * @systemapi
1599     * @since 10
1600     */
1601    STREAM_USAGE_SYSTEM = 9,
1602    /**
1603     * Movie or video usage.
1604     * @syscap SystemCapability.Multimedia.Audio.Core
1605     * @since 10
1606     */
1607    /**
1608     * Movie or video usage.
1609     * @syscap SystemCapability.Multimedia.Audio.Core
1610     * @crossplatform
1611     * @atomicservice
1612     * @since 12
1613     */
1614    STREAM_USAGE_MOVIE = 10,
1615    /**
1616     * Game sound effect usage.
1617     * @syscap SystemCapability.Multimedia.Audio.Core
1618     * @since 10
1619     */
1620    /**
1621     * Game sound effect usage.
1622     * @syscap SystemCapability.Multimedia.Audio.Core
1623     * @crossplatform
1624     * @atomicservice
1625     * @since 12
1626     */
1627    STREAM_USAGE_GAME = 11,
1628    /**
1629     * Audiobook usage.
1630     * @syscap SystemCapability.Multimedia.Audio.Core
1631     * @since 10
1632     */
1633    /**
1634     * Audiobook usage.
1635     * @syscap SystemCapability.Multimedia.Audio.Core
1636     * @crossplatform
1637     * @atomicservice
1638     * @since 12
1639     */
1640    STREAM_USAGE_AUDIOBOOK = 12,
1641    /**
1642     * Navigation usage.
1643     * @syscap SystemCapability.Multimedia.Audio.Core
1644     * @since 10
1645     */
1646    /**
1647     * Navigation usage.
1648     * @syscap SystemCapability.Multimedia.Audio.Core
1649     * @crossplatform
1650     * @atomicservice
1651     * @since 12
1652     */
1653    STREAM_USAGE_NAVIGATION = 13,
1654    /**
1655     * DTMF dial tone usage.
1656     * @syscap SystemCapability.Multimedia.Audio.Core
1657     * @systemapi
1658     * @since 10
1659     */
1660    STREAM_USAGE_DTMF = 14,
1661    /**
1662     * Enforced tone usage, such as camera shutter.
1663     * @syscap SystemCapability.Multimedia.Audio.Core
1664     * @systemapi
1665     * @since 10
1666     */
1667    STREAM_USAGE_ENFORCED_TONE = 15,
1668    /**
1669     * Ultrasonic playing usage. This type is only used for msdp condition.
1670     * @syscap SystemCapability.Multimedia.Audio.Core
1671     * @systemapi
1672     * @since 10
1673     */
1674    STREAM_USAGE_ULTRASONIC = 16,
1675    /**
1676     * Video call usage.
1677     * @syscap SystemCapability.Multimedia.Audio.Core
1678     * @atomicservice
1679     * @since 12
1680     */
1681    STREAM_USAGE_VIDEO_COMMUNICATION = 17,
1682    /**
1683     * Voice call assistant type. This type is only used for call assistant functionalities.
1684     * @syscap SystemCapability.Multimedia.Audio.Core
1685     * @systemapi
1686     * @since 12
1687     */
1688    STREAM_USAGE_VOICE_CALL_ASSISTANT = 21,
1689  }
1690
1691  /**
1692   * Enumerates the audio interrupt request type.
1693   * @enum { number }
1694   * @syscap SystemCapability.Multimedia.Audio.Interrupt
1695   * @systemapi
1696   * @since 9
1697   */
1698  enum InterruptRequestType {
1699    /**
1700     * Default type to request audio interrupt.
1701     * @syscap SystemCapability.Multimedia.Audio.Interrupt
1702     * @systemapi
1703     * @since 9
1704     */
1705    INTERRUPT_REQUEST_TYPE_DEFAULT = 0,
1706  }
1707
1708  /**
1709   * Enumerates volume related operations.
1710   * Flags should be powers of 2!
1711   * @enum { number }
1712   * @syscap SystemCapability.Multimedia.Audio.Volume
1713   * @systemapi
1714   * @since 12
1715   */
1716  enum VolumeFlag {
1717    /**
1718     * Show system volume bar.
1719     * @syscap SystemCapability.Multimedia.Audio.Volume
1720     * @systemapi
1721     * @since 12
1722     */
1723    FLAG_SHOW_SYSTEM_UI = 1,
1724  }
1725
1726  /**
1727   * Describes audio stream information.
1728   * @typedef AudioStreamInfo
1729   * @syscap SystemCapability.Multimedia.Audio.Core
1730   * @since 8
1731   */
1732   /**
1733   * Describes audio stream information.
1734   * @typedef AudioStreamInfo
1735   * @syscap SystemCapability.Multimedia.Audio.Core
1736   * @crossplatform
1737   * @since 12
1738   */
1739  interface AudioStreamInfo {
1740    /**
1741     * Sampling rate.
1742     * @type { AudioSamplingRate }
1743     * @syscap SystemCapability.Multimedia.Audio.Core
1744     * @since 8
1745     */
1746    /**
1747     * Sampling rate.
1748     * @type { AudioSamplingRate }
1749     * @syscap SystemCapability.Multimedia.Audio.Core
1750     * @crossplatform
1751     * @since 12
1752     */
1753    samplingRate: AudioSamplingRate;
1754    /**
1755     * Audio channels.
1756     * @type { AudioChannel }
1757     * @syscap SystemCapability.Multimedia.Audio.Core
1758     * @since 8
1759     */
1760   /**
1761     * Audio channels.
1762    * @type { AudioChannel }
1763     * @syscap SystemCapability.Multimedia.Audio.Core
1764     * @crossplatform
1765     * @since 12
1766     */
1767    channels: AudioChannel;
1768    /**
1769     * Audio sample format.
1770     * @type { AudioSampleFormat }
1771     * @syscap SystemCapability.Multimedia.Audio.Core
1772     * @since 8
1773     */
1774    /**
1775     * Audio sample format.
1776     * @type { AudioSampleFormat }
1777     * @syscap SystemCapability.Multimedia.Audio.Core
1778     * @crossplatform
1779     * @since 12
1780     */
1781    sampleFormat: AudioSampleFormat;
1782    /**
1783     * Audio encoding type.
1784     * @type { AudioEncodingType }
1785     * @syscap SystemCapability.Multimedia.Audio.Core
1786     * @since 8
1787     */
1788    /**
1789     * Audio encoding type.
1790     * @type { AudioEncodingType }
1791     * @syscap SystemCapability.Multimedia.Audio.Core
1792     * @crossplatform
1793     * @since 12
1794     */
1795    encodingType: AudioEncodingType;
1796    /**
1797     * Audio channel layout.
1798     * @type { ?AudioChannelLayout }
1799     * @syscap SystemCapability.Multimedia.Audio.Core
1800     * @since 11
1801     */
1802    /**
1803     * Audio channel layout.
1804     * @type { ?AudioChannelLayout }
1805     * @syscap SystemCapability.Multimedia.Audio.Core
1806     * @crossplatform
1807     * @since 12
1808     */
1809    channelLayout?: AudioChannelLayout;
1810  }
1811
1812  /**
1813   * Describes audio renderer information.
1814   * @typedef AudioRendererInfo
1815   * @syscap SystemCapability.Multimedia.Audio.Core
1816   * @since 8
1817   */
1818  /**
1819   * Describes audio renderer information.
1820   * @typedef AudioRendererInfo
1821   * @syscap SystemCapability.Multimedia.Audio.Core
1822   * @crossplatform
1823   * @atomicservice
1824   * @since 12
1825   */
1826  interface AudioRendererInfo {
1827    /**
1828     * Content type.
1829     * @type { ContentType }
1830     * @syscap SystemCapability.Multimedia.Audio.Core
1831     * @since 8
1832     * @deprecated since 10
1833     * @useinstead ohos.multimedia.audio.AudioRendererInfo#usage
1834     */
1835    /**
1836     * Content type.
1837     * @type { ?ContentType }
1838     * @syscap SystemCapability.Multimedia.Audio.Core
1839     * @since 10
1840     */
1841    content?: ContentType;
1842    /**
1843     * Stream usage.
1844     * @type { StreamUsage }
1845     * @syscap SystemCapability.Multimedia.Audio.Core
1846     * @since 8
1847     */
1848    /**
1849     * Stream usage.
1850     * @type { StreamUsage }
1851     * @syscap SystemCapability.Multimedia.Audio.Core
1852     * @crossplatform
1853     * @atomicservice
1854     * @since 12
1855     */
1856    usage: StreamUsage;
1857    /**
1858     * Audio renderer flags.
1859     * @type { number }
1860     * @syscap SystemCapability.Multimedia.Audio.Core
1861     * @since 8
1862     */
1863    /**
1864     * Audio renderer flags.
1865     * @type { number }
1866     * @syscap SystemCapability.Multimedia.Audio.Core
1867     * @crossplatform
1868     * @atomicservice
1869     * @since 12
1870     */
1871    rendererFlags: number;
1872  }
1873
1874  /**
1875   * Describes audio renderer filter.
1876   * @typedef AudioRendererFilter
1877   * @syscap SystemCapability.Multimedia.Audio.Core
1878   * @systemapi
1879   * @since 9
1880   */
1881  interface AudioRendererFilter {
1882    /**
1883     * Application uid.
1884     * @type { ?number }
1885     * @syscap SystemCapability.Multimedia.Audio.Core
1886     * @systemapi
1887     * @since 9
1888     */
1889    uid?: number;
1890    /**
1891     * Renderer information.
1892     * @type { ?AudioRendererInfo }
1893     * @syscap SystemCapability.Multimedia.Audio.Renderer
1894     * @systemapi
1895     * @since 9
1896     */
1897    rendererInfo?: AudioRendererInfo;
1898    /**
1899     * AudioRenderer id.
1900     * @type { ?number }
1901     * @syscap SystemCapability.Multimedia.Audio.Renderer
1902     * @systemapi
1903     * @since 9
1904     */
1905    rendererId?: number;
1906  }
1907
1908  /**
1909   * Describes audio renderer configuration options.
1910   * @typedef AudioRendererOptions
1911   * @syscap SystemCapability.Multimedia.Audio.Renderer
1912   * @since 8
1913   */
1914   /**
1915   * Describes audio renderer configuration options.
1916   * @typedef AudioRendererOptions
1917   * @syscap SystemCapability.Multimedia.Audio.Renderer
1918   * @crossplatform
1919   * @since 12
1920   */
1921  interface AudioRendererOptions {
1922    /**
1923     * Stream information.
1924     * @type { AudioStreamInfo }
1925     * @syscap SystemCapability.Multimedia.Audio.Renderer
1926     * @since 8
1927     */
1928    /**
1929     * Stream information.
1930     * @type { AudioStreamInfo }
1931     * @syscap SystemCapability.Multimedia.Audio.Renderer
1932     * @crossplatform
1933     * @since 12
1934     */
1935    streamInfo: AudioStreamInfo;
1936    /**
1937     * Renderer information.
1938     * @type { AudioRendererInfo }
1939     * @syscap SystemCapability.Multimedia.Audio.Renderer
1940     * @since 8
1941     */
1942    /**
1943     * Renderer information.
1944     * @type { AudioRendererInfo }
1945     * @syscap SystemCapability.Multimedia.Audio.Renderer
1946     * @crossplatform
1947     * @since 12
1948     */
1949    rendererInfo: AudioRendererInfo;
1950    /**
1951     * Privacy configuration.
1952     * @type { ?AudioPrivacyType }
1953     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1954     * @since 10
1955     */
1956    /**
1957     * Privacy configuration.
1958     * @type { ?AudioPrivacyType }
1959     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1960     * @crossplatform
1961     * @since 12
1962     */
1963    privacyType?: AudioPrivacyType;
1964  }
1965
1966  /**
1967   * Enumerates audio stream privacy type for playback capture.
1968   * @enum { number }
1969   * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1970   * @since 10
1971   */
1972  /**
1973   * Enumerates audio stream privacy type for playback capture.
1974   * @enum { number }
1975   * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1976   * @crossplatform
1977   * @since 12
1978   */
1979  enum AudioPrivacyType {
1980    /**
1981     * Privacy type that stream can be captured by third party applications.
1982     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1983     * @since 10
1984     */
1985    /**
1986     * Privacy type that stream can be captured by third party applications.
1987     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1988     * @crossplatform
1989     * @since 12
1990     */
1991    PRIVACY_TYPE_PUBLIC = 0,
1992
1993    /**
1994     * Privacy type that stream can not be captured.
1995     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
1996     * @since 10
1997     */
1998    /**
1999     * Privacy type that stream can not be captured.
2000     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
2001     * @crossplatform
2002     * @since 12
2003     */
2004    PRIVACY_TYPE_PRIVATE = 1,
2005  }
2006
2007  /**
2008   * Enumerates the interrupt modes.
2009   * @enum { number }
2010   * @syscap SystemCapability.Multimedia.Audio.Interrupt
2011   * @since 9
2012   */
2013  /**
2014   * Enumerates the interrupt modes.
2015   * @enum { number }
2016   * @syscap SystemCapability.Multimedia.Audio.Interrupt
2017   * @crossplatform
2018   * @atomicservice
2019   * @since 12
2020   */
2021  enum InterruptMode {
2022    /**
2023     * Mode that different stream share one interrupt unit.
2024     * @syscap SystemCapability.Multimedia.Audio.Interrupt
2025     * @since 9
2026     */
2027    /**
2028     * Mode that different stream share one interrupt unit.
2029     * @syscap SystemCapability.Multimedia.Audio.Interrupt
2030     * @crossplatform
2031     * @atomicservice
2032     * @since 12
2033     */
2034    SHARE_MODE = 0,
2035    /**
2036     * Mode that each stream has independent interrupt unit.
2037     * @syscap SystemCapability.Multimedia.Audio.Interrupt
2038     * @since 9
2039     */
2040    /**
2041     * Mode that each stream has independent interrupt unit.
2042     * @syscap SystemCapability.Multimedia.Audio.Interrupt
2043     * @crossplatform
2044     * @atomicservice
2045     * @since 12
2046     */
2047    INDEPENDENT_MODE = 1
2048  }
2049
2050  /**
2051   * Enumerates the audio renderer rates.
2052   * @enum { number }
2053   * @syscap SystemCapability.Multimedia.Audio.Renderer
2054   * @since 8
2055   */
2056  enum AudioRendererRate {
2057    /**
2058     * Normal rate.
2059     * @syscap SystemCapability.Multimedia.Audio.Renderer
2060     * @since 8
2061     */
2062    RENDER_RATE_NORMAL = 0,
2063    /**
2064     * Double rate.
2065     * @syscap SystemCapability.Multimedia.Audio.Renderer
2066     * @since 8
2067     */
2068    RENDER_RATE_DOUBLE = 1,
2069    /**
2070     * Half rate.
2071     * @syscap SystemCapability.Multimedia.Audio.Renderer
2072     * @since 8
2073     */
2074    RENDER_RATE_HALF = 2
2075  }
2076
2077  /**
2078   * Enumerates the interrupt types.
2079   * @enum { number }
2080   * @syscap SystemCapability.Multimedia.Audio.Renderer
2081   * @since 7
2082   */
2083  /**
2084   * Enumerates the interrupt types.
2085   * @enum { number }
2086   * @syscap SystemCapability.Multimedia.Audio.Renderer
2087   * @crossplatform
2088   * @atomicservice
2089   * @since 12
2090   */
2091  enum InterruptType {
2092    /**
2093     * Audio playback interruption started.
2094     * @syscap SystemCapability.Multimedia.Audio.Renderer
2095     * @since 7
2096     */
2097    /**
2098     * Audio playback interruption started.
2099     * @syscap SystemCapability.Multimedia.Audio.Renderer
2100     * @crossplatform
2101     * @atomicservice
2102     * @since 12
2103     */
2104    INTERRUPT_TYPE_BEGIN = 1,
2105
2106    /**
2107     * Audio playback interruption ended.
2108     * @syscap SystemCapability.Multimedia.Audio.Renderer
2109     * @since 7
2110     */
2111    /**
2112     * Audio playback interruption ended.
2113     * @syscap SystemCapability.Multimedia.Audio.Renderer
2114     * @crossplatform
2115     * @atomicservice
2116     * @since 12
2117     */
2118    INTERRUPT_TYPE_END = 2
2119  }
2120
2121  /**
2122   * Enumerates the interrupt hints.
2123   * @enum { number }
2124   * @syscap SystemCapability.Multimedia.Audio.Renderer
2125   * @since 7
2126   */
2127  /**
2128   * Enumerates the interrupt hints.
2129   * @enum { number }
2130   * @syscap SystemCapability.Multimedia.Audio.Renderer
2131   * @crossplatform
2132   * @atomicservice
2133   * @since 12
2134   */
2135  enum InterruptHint {
2136    /**
2137     * None.
2138     * @syscap SystemCapability.Multimedia.Audio.Renderer
2139     * @since 8
2140     */
2141    /**
2142     * None.
2143     * @syscap SystemCapability.Multimedia.Audio.Renderer
2144     * @atomicservice
2145     * @since 12
2146     */
2147    INTERRUPT_HINT_NONE = 0,
2148    /**
2149     * Resume the playback.
2150     * @syscap SystemCapability.Multimedia.Audio.Renderer
2151     * @since 7
2152     */
2153    /**
2154     * Resume the playback.
2155     * @syscap SystemCapability.Multimedia.Audio.Renderer
2156     * @crossplatform
2157     * @atomicservice
2158     * @since 12
2159     */
2160    INTERRUPT_HINT_RESUME = 1,
2161
2162    /**
2163     * Paused/Pause the playback.
2164     * @syscap SystemCapability.Multimedia.Audio.Renderer
2165     * @since 7
2166     */
2167    /**
2168     * Paused/Pause the playback.
2169     * @syscap SystemCapability.Multimedia.Audio.Renderer
2170     * @atomicservice
2171     * @since 12
2172     */
2173    INTERRUPT_HINT_PAUSE = 2,
2174
2175    /**
2176     * Stopped/Stop the playback.
2177     * @syscap SystemCapability.Multimedia.Audio.Renderer
2178     * @since 7
2179     */
2180    /**
2181     * Stopped/Stop the playback.
2182     * @syscap SystemCapability.Multimedia.Audio.Renderer
2183     * @atomicservice
2184     * @since 12
2185     */
2186    INTERRUPT_HINT_STOP = 3,
2187
2188    /**
2189     * Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.)
2190     * @syscap SystemCapability.Multimedia.Audio.Renderer
2191     * @since 7
2192     */
2193    /**
2194     * Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.)
2195     * @syscap SystemCapability.Multimedia.Audio.Renderer
2196     * @atomicservice
2197     * @since 12
2198     */
2199    INTERRUPT_HINT_DUCK = 4,
2200
2201    /**
2202     * Unducked the playback.
2203     * @syscap SystemCapability.Multimedia.Audio.Renderer
2204     * @since 8
2205     */
2206    /**
2207     * Unducked the playback.
2208     * @syscap SystemCapability.Multimedia.Audio.Renderer
2209     * @atomicservice
2210     * @since 12
2211     */
2212    INTERRUPT_HINT_UNDUCK = 5,
2213  }
2214
2215  /**
2216   * Enumerates the interrupt force types.
2217   * @enum { number }
2218   * @syscap SystemCapability.Multimedia.Audio.Renderer
2219   * @since 9
2220   */
2221  /**
2222   * Enumerates the interrupt force types.
2223   * @enum { number }
2224   * @syscap SystemCapability.Multimedia.Audio.Renderer
2225   * @crossplatform
2226   * @atomicservice
2227   * @since 12
2228   */
2229  enum InterruptForceType {
2230    /**
2231     * Forced action taken by system.
2232     * @syscap SystemCapability.Multimedia.Audio.Renderer
2233     * @since 9
2234     */
2235    /**
2236     * Forced action taken by system.
2237     * @syscap SystemCapability.Multimedia.Audio.Renderer
2238     * @crossplatform
2239     * @atomicservice
2240     * @since 12
2241     */
2242    INTERRUPT_FORCE = 0,
2243    /**
2244     * Share type, application can choose to take action or ignore.
2245     * @syscap SystemCapability.Multimedia.Audio.Renderer
2246     * @since 9
2247     */
2248    /**
2249     * Share type, application can choose to take action or ignore.
2250     * @syscap SystemCapability.Multimedia.Audio.Renderer
2251     * @atomicservice
2252     * @since 12
2253     */
2254    INTERRUPT_SHARE = 1
2255  }
2256
2257  /**
2258   * Describes the interrupt event received by the app when playback is interrupted.
2259   * @typedef InterruptEvent
2260   * @syscap SystemCapability.Multimedia.Audio.Renderer
2261   * @since 9
2262   */
2263  /**
2264   * Describes the interrupt event received by the app when playback is interrupted.
2265   * @typedef InterruptEvent
2266   * @syscap SystemCapability.Multimedia.Audio.Renderer
2267   * @crossplatform
2268   * @atomicservice
2269   * @since 12
2270   */
2271  interface InterruptEvent {
2272    /**
2273     * Indicates whether the interruption has started or finished.
2274     * @type { InterruptType }
2275     * @syscap SystemCapability.Multimedia.Audio.Renderer
2276     * @since 9
2277     */
2278    /**
2279     * Indicates whether the interruption has started or finished.
2280     * @type { InterruptType }
2281     * @syscap SystemCapability.Multimedia.Audio.Renderer
2282     * @crossplatform
2283     * @atomicservice
2284     * @since 12
2285     */
2286    eventType: InterruptType;
2287
2288    /**
2289     * Indicates whether the action is taken by system or to be taken by the app.
2290     * @type { InterruptForceType }
2291     * @syscap SystemCapability.Multimedia.Audio.Renderer
2292     * @since 9
2293     */
2294    /**
2295     * Indicates whether the action is taken by system or to be taken by the app.
2296     * @type { InterruptForceType }
2297     * @syscap SystemCapability.Multimedia.Audio.Renderer
2298     * @crossplatform
2299     * @atomicservice
2300     * @since 12
2301     */
2302    forceType: InterruptForceType;
2303
2304    /**
2305     * Indicates the kind of action.
2306     * @type { InterruptHint }
2307     * @syscap SystemCapability.Multimedia.Audio.Renderer
2308     * @since 9
2309     */
2310    /**
2311     * Indicates the kind of action.
2312     * @type { InterruptHint }
2313     * @syscap SystemCapability.Multimedia.Audio.Renderer
2314     * @crossplatform
2315     * @atomicservice
2316     * @since 12
2317     */
2318    hintType: InterruptHint;
2319  }
2320
2321  /**
2322   * Enumerates interrupt action types.
2323   * @enum { number }
2324   * @syscap SystemCapability.Multimedia.Audio.Renderer
2325   * @since 7
2326   * @deprecated since 9
2327   */
2328  enum InterruptActionType {
2329
2330    /**
2331     * Focus gain event.
2332     * @syscap SystemCapability.Multimedia.Audio.Renderer
2333     * @since 7
2334     * @deprecated since 9
2335     */
2336    TYPE_ACTIVATED = 0,
2337
2338    /**
2339     * Audio interruption event.
2340     * @syscap SystemCapability.Multimedia.Audio.Renderer
2341     * @since 7
2342     * @deprecated since 9
2343     */
2344    TYPE_INTERRUPT = 1
2345  }
2346
2347  /**
2348   * Enumerates device change types.
2349   * @enum { number }
2350   * @syscap SystemCapability.Multimedia.Audio.Device
2351   * @since 7
2352   */
2353  /**
2354   * Enumerates device change types.
2355   * @enum { number }
2356   * @syscap SystemCapability.Multimedia.Audio.Device
2357   * @crossplatform
2358   * @since 12
2359   */
2360  enum DeviceChangeType {
2361    /**
2362     * Device connection.
2363     * @syscap SystemCapability.Multimedia.Audio.Device
2364     * @since 7
2365     */
2366    /**
2367     * Device connection.
2368     * @syscap SystemCapability.Multimedia.Audio.Device
2369     * @crossplatform
2370     * @since 12
2371     */
2372    CONNECT = 0,
2373
2374    /**
2375     * Device disconnection.
2376     * @syscap SystemCapability.Multimedia.Audio.Device
2377     * @since 7
2378     */
2379    /**
2380     * Device disconnection.
2381     * @syscap SystemCapability.Multimedia.Audio.Device
2382     * @crossplatform
2383     * @since 12
2384     */
2385    DISCONNECT = 1,
2386  }
2387
2388  /**
2389   * Enumerates audio scenes.
2390   * @enum { number }
2391   * @syscap SystemCapability.Multimedia.Audio.Communication
2392   * @since 8
2393   */
2394  /**
2395   * Enumerates audio scenes.
2396   * @enum { number }
2397   * @syscap SystemCapability.Multimedia.Audio.Communication
2398   * @crossplatform
2399   * @since 12
2400   */
2401  enum AudioScene {
2402    /**
2403     * Default audio scene
2404     * @syscap SystemCapability.Multimedia.Audio.Communication
2405     * @since 8
2406     */
2407    /**
2408     * Default audio scene
2409     * @syscap SystemCapability.Multimedia.Audio.Communication
2410     * @crossplatform
2411     * @since 12
2412     */
2413    AUDIO_SCENE_DEFAULT = 0,
2414    /**
2415     * Ringing audio scene
2416     * @syscap SystemCapability.Multimedia.Audio.Communication
2417     * @since 12
2418     */
2419    AUDIO_SCENE_RINGING = 1,
2420    /**
2421     * Phone call audio scene
2422     * @syscap SystemCapability.Multimedia.Audio.Communication
2423     * @since 12
2424     */
2425    AUDIO_SCENE_PHONE_CALL = 2,
2426    /**
2427     * Voice chat audio scene
2428     * @syscap SystemCapability.Multimedia.Audio.Communication
2429     * @since 8
2430     */
2431    /**
2432     * Voice chat audio scene
2433     * @syscap SystemCapability.Multimedia.Audio.Communication
2434     * @crossplatform
2435     * @since 12
2436     */
2437    AUDIO_SCENE_VOICE_CHAT = 3
2438  }
2439
2440  /**
2441   * Enumerates volume adjustment types.
2442   * @enum { number }
2443   * @syscap SystemCapability.Multimedia.Audio.Volume
2444   * @systemapi
2445   * @since 10
2446   */
2447  enum VolumeAdjustType {
2448    /**
2449     * Adjust volume up.
2450     * @syscap SystemCapability.Multimedia.Audio.Volume
2451     * @systemapi
2452     * @since 10
2453     */
2454    VOLUME_UP = 0,
2455    /**
2456     * Adjust volume down.
2457     * @syscap SystemCapability.Multimedia.Audio.Volume
2458     * @systemapi
2459     * @since 10
2460     */
2461    VOLUME_DOWN = 1,
2462  }
2463
2464  /**
2465   * Implements audio volume and audio device management.
2466   * @typedef AudioManager
2467   * @syscap SystemCapability.Multimedia.Audio.Core
2468   * @since 7
2469   */
2470  /**
2471   * Implements audio volume and audio device management.
2472   * @typedef AudioManager
2473   * @syscap SystemCapability.Multimedia.Audio.Core
2474   * @crossplatform
2475   * @since 12
2476   */
2477  interface AudioManager {
2478    /**
2479     * Sets the volume for a stream. This method uses an asynchronous callback to return the result.
2480     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
2481     * @param { AudioVolumeType } volumeType - Audio stream type.
2482     * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume.
2483     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2484     * @syscap SystemCapability.Multimedia.Audio.Volume
2485     * @since 7
2486     * @deprecated since 9
2487     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume
2488     */
2489    setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback<void>): void;
2490    /**
2491     * Sets the volume for a stream. This method uses a promise to return the result.
2492     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
2493     * @param { AudioVolumeType } volumeType - Audio stream type.
2494     * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume.
2495     * @returns { Promise<void> } Promise used to return the result.
2496     * @syscap SystemCapability.Multimedia.Audio.Volume
2497     * @since 7
2498     * @deprecated since 9
2499     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume
2500     */
2501    setVolume(volumeType: AudioVolumeType, volume: number): Promise<void>;
2502    /**
2503     * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result.
2504     * @param { AudioVolumeType } volumeType - Audio stream type.
2505     * @param { AsyncCallback<number> } callback - Callback used to return the volume.
2506     * @syscap SystemCapability.Multimedia.Audio.Volume
2507     * @since 7
2508     * @deprecated since 9
2509     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume
2510     */
2511    getVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
2512    /**
2513     * Obtains the volume of a stream. This method uses a promise to return the query result.
2514     * @param { AudioVolumeType } volumeType - Audio stream type.
2515     * @returns { Promise<number> } Promise used to return the volume.
2516     * @syscap SystemCapability.Multimedia.Audio.Volume
2517     * @since 7
2518     * @deprecated since 9
2519     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume
2520     */
2521    getVolume(volumeType: AudioVolumeType): Promise<number>;
2522    /**
2523     * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
2524     * @param { AudioVolumeType } volumeType - Audio stream type.
2525     * @param { AsyncCallback<number> } callback - Callback used to return the minimum volume.
2526     * @syscap SystemCapability.Multimedia.Audio.Volume
2527     * @since 7
2528     * @deprecated since 9
2529     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume
2530     */
2531    getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
2532    /**
2533     * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result.
2534     * @param { AudioVolumeType } volumeType - Audio stream type.
2535     * @returns { Promise<number> } Promise used to return the minimum volume.
2536     * @syscap SystemCapability.Multimedia.Audio.Volume
2537     * @since 7
2538     * @deprecated since 9
2539     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume
2540     */
2541    getMinVolume(volumeType: AudioVolumeType): Promise<number>;
2542    /**
2543     * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
2544     * @param { AudioVolumeType } volumeType - Audio stream type.
2545     * @param { AsyncCallback<number> } callback - Callback used to return the maximum volume.
2546     * @syscap SystemCapability.Multimedia.Audio.Volume
2547     * @since 7
2548     * @deprecated since 9
2549     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume
2550     */
2551    getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
2552    /**
2553     * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result.
2554     * @param { AudioVolumeType } volumeType - Audio stream type.
2555     * @returns { Promise<number> } Promise used to return the maximum volume.
2556     * @syscap SystemCapability.Multimedia.Audio.Volume
2557     * @since 7
2558     * @deprecated since 9
2559     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume
2560     */
2561    getMaxVolume(volumeType: AudioVolumeType): Promise<number>;
2562    /**
2563     * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result.
2564     * @param { DeviceFlag } deviceFlag - Audio device flag.
2565     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the device list.
2566     * @syscap SystemCapability.Multimedia.Audio.Device
2567     * @since 7
2568     * @deprecated since 9
2569     * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices
2570     */
2571    getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback<AudioDeviceDescriptors>): void;
2572    /**
2573     * Obtains the audio devices with a specific flag. This method uses a promise to return the query result.
2574     * @param { DeviceFlag } deviceFlag - Audio device flag.
2575     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the device list.
2576     * @syscap SystemCapability.Multimedia.Audio.Device
2577     * @since 7
2578     * @deprecated since 9
2579     * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices
2580     */
2581    getDevices(deviceFlag: DeviceFlag): Promise<AudioDeviceDescriptors>;
2582    /**
2583     * Mutes a stream. This method uses an asynchronous callback to return the result.
2584     * @param { AudioVolumeType } volumeType - Audio stream type.
2585     * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite.
2586     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2587     * @syscap SystemCapability.Multimedia.Audio.Volume
2588     * @since 7
2589     * @deprecated since 9
2590     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute
2591     */
2592    mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback<void>): void;
2593    /**
2594     * Mutes a stream. This method uses a promise to return the result.
2595     * @param { AudioVolumeType } volumeType - Audio stream type.
2596     * @param { boolean } mute -  Mute status to set. The value true means to mute the stream, and false means the opposite.
2597     * @returns { Promise<void> } Promise used to return the result.
2598     * @syscap SystemCapability.Multimedia.Audio.Volume
2599     * @since 7
2600     * @deprecated since 9
2601     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute
2602     */
2603    mute(volumeType: AudioVolumeType, mute: boolean): Promise<void>;
2604    /**
2605     * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result.
2606     * @param { AudioVolumeType } volumeType - Audio stream type.
2607     * @param { AsyncCallback<boolean> } callback - Callback used to return the mute status of the stream.
2608     *        The value true means that the stream is muted, and false means the opposite.
2609     * @syscap SystemCapability.Multimedia.Audio.Volume
2610     * @since 7
2611     * @deprecated since 9
2612     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute
2613     */
2614    isMute(volumeType: AudioVolumeType, callback: AsyncCallback<boolean>): void;
2615    /**
2616     * Checks whether a stream is muted. This method uses a promise to return the result.
2617     * @param { AudioVolumeType } volumeType - Audio stream type.
2618     * @returns { Promise<boolean> } Promise used to return the mute status of the stream. The value true means
2619     *          that the stream is muted, and false means the opposite.
2620     * @syscap SystemCapability.Multimedia.Audio.Volume
2621     * @since 7
2622     * @deprecated since 9
2623     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute
2624     */
2625    isMute(volumeType: AudioVolumeType): Promise<boolean>;
2626    /**
2627     * Checks whether a stream is active. This method uses an asynchronous callback to return the query result.
2628     * @param { AudioVolumeType } volumeType - Audio stream type.
2629     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the stream.
2630     *        The value true means that the stream is active, and false means the opposite.
2631     * @syscap SystemCapability.Multimedia.Audio.Volume
2632     * @since 7
2633     * @deprecated since 9
2634     * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive
2635     */
2636    isActive(volumeType: AudioVolumeType, callback: AsyncCallback<boolean>): void;
2637    /**
2638     * Checks whether a stream is active. This method uses a promise to return the query result.
2639     * @param { AudioVolumeType } volumeType - Audio stream type.
2640     * @returns { Promise<boolean> } Promise used to return the active status of the stream. The value true means
2641     *          that the stream is active, and false means the opposite.
2642     * @syscap SystemCapability.Multimedia.Audio.Volume
2643     * @since 7
2644     * @deprecated since 9
2645     * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive
2646     */
2647    isActive(volumeType: AudioVolumeType): Promise<boolean>;
2648    /**
2649     * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result.
2650     * @permission ohos.permission.MICROPHONE
2651     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
2652     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2653     * @syscap SystemCapability.Multimedia.Audio.Device
2654     * @since 7
2655     * @deprecated since 9
2656     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute
2657     */
2658    setMicrophoneMute(mute: boolean, callback: AsyncCallback<void>): void;
2659    /**
2660     * Mutes or unmutes the microphone. This method uses a promise to return the result.
2661     * @permission ohos.permission.MICROPHONE
2662     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
2663     * @returns { Promise<void> } Promise used to return the result.
2664     * @syscap SystemCapability.Multimedia.Audio.Device
2665     * @since 7
2666     * @deprecated since 9
2667     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute
2668     */
2669    setMicrophoneMute(mute: boolean): Promise<void>;
2670    /**
2671     * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result.
2672     * @permission ohos.permission.MICROPHONE
2673     * @param { AsyncCallback<boolean> } callback - used to return the mute status of the microphone. The value
2674     *        true means that the microphone is muted, and false means the opposite.
2675     * @syscap SystemCapability.Multimedia.Audio.Device
2676     * @since 7
2677     * @deprecated since 9
2678     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute
2679     */
2680    isMicrophoneMute(callback: AsyncCallback<boolean>): void;
2681    /**
2682     * Checks whether the microphone is muted. This method uses a promise to return the query result.
2683     * @permission ohos.permission.MICROPHONE
2684     * @returns { Promise<boolean> } Promise used to return the mute status of the microphone. The value
2685     *          true means that the microphone is muted, and false means the opposite.
2686     * @syscap SystemCapability.Multimedia.Audio.Device
2687     * @since 7
2688     * @deprecated since 9
2689     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute
2690     */
2691    isMicrophoneMute(): Promise<boolean>;
2692    /**
2693     * Sets the ringer mode. This method uses an asynchronous callback to return the result.
2694     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
2695     * @param { AudioRingMode } mode - Ringer mode.
2696     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2697     * @syscap SystemCapability.Multimedia.Audio.Communication
2698     * @since 7
2699     * @deprecated since 9
2700     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode
2701     */
2702    setRingerMode(mode: AudioRingMode, callback: AsyncCallback<void>): void;
2703    /**
2704     * Sets the ringer mode. This method uses a promise to return the result.
2705     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
2706     * @param { AudioRingMode } mode - Ringer mode.
2707     * @returns { Promise<void> } Promise used to return the result.
2708     * @syscap SystemCapability.Multimedia.Audio.Communication
2709     * @since 7
2710     * @deprecated since 9
2711     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode
2712     */
2713    setRingerMode(mode: AudioRingMode): Promise<void>;
2714    /**
2715     * Obtains the ringer mode. This method uses an asynchronous callback to return the query result.
2716     * @param { AsyncCallback<AudioRingMode> } callback - Callback used to return the ringer mode.
2717     * @syscap SystemCapability.Multimedia.Audio.Communication
2718     * @since 7
2719     * @deprecated since 9
2720     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode
2721     */
2722    getRingerMode(callback: AsyncCallback<AudioRingMode>): void;
2723    /**
2724     * Obtains the ringer mode. This method uses a promise to return the query result.
2725     * @returns { Promise<AudioRingMode> } Promise used to return the ringer mode.
2726     * @syscap SystemCapability.Multimedia.Audio.Communication
2727     * @since 7
2728     * @deprecated since 9
2729     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode
2730     */
2731    getRingerMode(): Promise<AudioRingMode>;
2732    /**
2733     * Sets an audio parameter. This method uses an asynchronous callback to return the result.
2734     * @permission ohos.permission.MODIFY_AUDIO_SETTINGS
2735     * @param { string } key - Key of the audio parameter to set.
2736     * @param { string } value -  Value of the audio parameter to set.
2737     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2738     * @syscap SystemCapability.Multimedia.Audio.Core
2739     * @since 7
2740     * @deprecated since 11
2741     * @useinstead ohos.multimedia.audio.AudioManager#setExtraParameters
2742     */
2743    setAudioParameter(key: string, value: string, callback: AsyncCallback<void>): void;
2744    /**
2745     * Sets an audio parameter. This method uses a promise to return the result.
2746     * @permission ohos.permission.MODIFY_AUDIO_SETTINGS
2747     * @param { string } key - Key of the audio parameter to set.
2748     * @param { string } value - Value of the audio parameter to set.
2749     * @returns { Promise<void> } Promise used to return the result.
2750     * @syscap SystemCapability.Multimedia.Audio.Core
2751     * @since 7
2752     * @deprecated since 11
2753     * @useinstead ohos.multimedia.audio.AudioManager#setExtraParameters
2754     */
2755    setAudioParameter(key: string, value: string): Promise<void>;
2756
2757    /**
2758     * Obtains the value of an audio parameter. This method uses an asynchronous callback to return the query result.
2759     * @param { string } key - Key of the audio parameter whose value is to be obtained.
2760     * @param { AsyncCallback<string> } callback - Callback used to return the value of the audio parameter.
2761     * @syscap SystemCapability.Multimedia.Audio.Core
2762     * @since 7
2763     * @deprecated since 11
2764     * @useinstead ohos.multimedia.audio.AudioManager#getExtraParameters
2765     */
2766    getAudioParameter(key: string, callback: AsyncCallback<string>): void;
2767    /**
2768     * Obtains the value of an audio parameter. This method uses a promise to return the query result.
2769     * @param { string } key - Key of the audio parameter whose value is to be obtained.
2770     * @returns { Promise<string> } Promise used to return the value of the audio parameter.
2771     * @syscap SystemCapability.Multimedia.Audio.Core
2772     * @since 7
2773     * @deprecated since 11
2774     * @useinstead ohos.multimedia.audio.AudioManager#getExtraParameters
2775     */
2776    getAudioParameter(key: string): Promise<string>;
2777
2778    /**
2779     * Sets extra audio parameters. This method uses a promise to return the result.
2780     * @permission ohos.permission.MODIFY_AUDIO_SETTINGS
2781     * @param { string } mainKey - Main key of the audio parameters to set.
2782     * @param { Record<string, string> } kvpairs - Key-value pairs with subkeys and values to set.
2783     * @returns { Promise<void> } Promise used to return the result.
2784     * @throws { BusinessError } 201 - Permission denied.
2785     * @throws { BusinessError } 202 - Not system App.
2786     * @throws { BusinessError } 401 - Parameter error. Possible causes:
2787     *                                 1.Mandatory parameters are left unspecified;
2788     *                                 2.Incorrect parameter types.
2789     * @throws { BusinessError } 6800101 - Parameter verification failed.
2790     * @syscap SystemCapability.Multimedia.Audio.Core
2791     * @systemapi
2792     * @since 11
2793     */
2794    setExtraParameters(mainKey: string, kvpairs: Record<string, string>): Promise<void>;
2795
2796    /**
2797     * Obtains the values of a certain key. This method uses a promise to return the query result.
2798     * @param { string } mainKey - Main key of the audio parameters to get.
2799     * @param { Array<string> } subKeys - Sub keys of the audio parameters to get.
2800     * @returns { Promise<Record<string, string>> } Promise used to return the key-value pairs.
2801     * @throws { BusinessError } 202 - Not system App.
2802     * @throws { BusinessError } 401 - Parameter error. Possible causes:
2803     *                                 1.Mandatory parameters are left unspecified;
2804     *                                 2.Incorrect parameter types.
2805     * @throws { BusinessError } 6800101 - Parameter verification failed.
2806     * @syscap SystemCapability.Multimedia.Audio.Core
2807     * @systemapi
2808     * @since 11
2809     */
2810    getExtraParameters(mainKey: string, subKeys?: Array<string>): Promise<Record<string, string>>;
2811
2812    /**
2813     * Sets a device to the active state. This method uses an asynchronous callback to return the result.
2814     * @param { ActiveDeviceType } deviceType - Audio device type.
2815     * @param { boolean } active - Active status to set. The value true means to set the device to the active
2816     *        status, and false means the opposite.
2817     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2818     * @syscap SystemCapability.Multimedia.Audio.Device
2819     * @since 7
2820     * @deprecated since 9
2821     * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice
2822     */
2823    setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback<void>): void;
2824    /**
2825     * Sets a device to the active state. This method uses a promise to return the result.
2826     * @param { ActiveDeviceType } deviceType - Audio device type.
2827     * @param { boolean } active - Active status to set. The value true means to set the device to the active
2828     *        status, and false means the opposite.
2829     * @returns { Promise<void> } Promise used to return the result.
2830     * @syscap SystemCapability.Multimedia.Audio.Device
2831     * @since 7
2832     * @deprecated since 9
2833     * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice
2834     */
2835    setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise<void>;
2836    /**
2837     * Checks whether a device is active. This method uses an asynchronous callback to return the query result.
2838     * @param { ActiveDeviceType } deviceType - Audio device type.
2839     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the device.
2840     * @syscap SystemCapability.Multimedia.Audio.Device
2841     * @since 7
2842     * @deprecated since 9
2843     * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive
2844     */
2845    isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback<boolean>): void;
2846    /**
2847     * Checks whether a device is active. This method uses a promise to return the query result.
2848     * @param { ActiveDeviceType } deviceType - Audio device type.
2849     * @returns { Promise<boolean> } Promise used to return the active status of the device.
2850     * @syscap SystemCapability.Multimedia.Audio.Device
2851     * @since 7
2852     * @deprecated since 9
2853     * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive
2854     */
2855    isDeviceActive(deviceType: ActiveDeviceType): Promise<boolean>;
2856    /**
2857     * Listens for system volume change events. This method uses a callback to get volume change events.
2858     * @param { 'volumeChange' } type - Type of the event to listen for. Only the volumeChange event is supported.
2859     * @param { Callback<VolumeEvent> } callback - Callback used to get the system volume change event.
2860     * @syscap SystemCapability.Multimedia.Audio.Volume
2861     * @systemapi
2862     * @since 8
2863     * @deprecated since 9
2864     * @useinstead ohos.multimedia.audio.AudioVolumeManager#event:volumeChange
2865     */
2866    on(type: 'volumeChange', callback: Callback<VolumeEvent>): void;
2867    /**
2868     * Listens for ringer mode change events. This method uses a callback to get ringer mode changes.
2869     * @param { 'ringerModeChange' } type - Type of the event to listen for. Only the ringerModeChange event is supported.
2870     * @param { Callback<AudioRingMode> } callback - Callback used to get the updated ringer mode.
2871     * @syscap SystemCapability.Multimedia.Audio.Communication
2872     * @systemapi
2873     * @since 8
2874     * @deprecated since 9
2875     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#event:ringerModeChange
2876     */
2877    on(type: 'ringerModeChange', callback: Callback<AudioRingMode>): void;
2878    /**
2879     * Sets the audio scene mode to change audio strategies. This method uses an asynchronous callback to return the
2880     * result.
2881     * @param { AudioScene } scene - Audio scene mode.
2882     * @param { AsyncCallback<void> } callback - Callback used to return the result.
2883     * @syscap SystemCapability.Multimedia.Audio.Communication
2884     * @systemapi
2885     * @since 8
2886     */
2887    setAudioScene(scene: AudioScene, callback: AsyncCallback<void>): void;
2888    /**
2889     * Sets the audio scene mode to change audio strategies. This method uses a promise to return the result.
2890     * @param { AudioScene } scene - Audio scene mode.
2891     * @returns { Promise<void> } Promise used to return the result.
2892     * @syscap SystemCapability.Multimedia.Audio.Communication
2893     * @systemapi
2894     * @since 8
2895     */
2896    setAudioScene(scene: AudioScene): Promise<void>;
2897    /**
2898     * Obtains the audio scene mode. This method uses an asynchronous callback to return the query result.
2899     * @param { AsyncCallback<AudioScene> } callback - Callback used to return the audio scene mode.
2900     * @syscap SystemCapability.Multimedia.Audio.Communication
2901     * @since 8
2902     */
2903    /**
2904     * Obtains the audio scene mode. This method uses an asynchronous callback to return the query result.
2905     * @param { AsyncCallback<AudioScene> } callback - Callback used to return the audio scene mode.
2906     * @syscap SystemCapability.Multimedia.Audio.Communication
2907     * @crossplatform
2908     * @since 12
2909     */
2910    getAudioScene(callback: AsyncCallback<AudioScene>): void;
2911    /**
2912     * Obtains the audio scene mode. This method uses a promise to return the query result.
2913     * @returns { Promise<AudioScene> } Promise used to return the audio scene mode.
2914     * @syscap SystemCapability.Multimedia.Audio.Communication
2915     * @since 8
2916     */
2917    /**
2918     * Obtains the audio scene mode. This method uses a promise to return the query result.
2919     * @returns { Promise<AudioScene> } Promise used to return the audio scene mode.
2920     * @syscap SystemCapability.Multimedia.Audio.Communication
2921     * @crossplatform
2922     * @since 12
2923     */
2924    getAudioScene(): Promise<AudioScene>;
2925    /**
2926     * Obtains the audio scene mode.
2927     * @returns { AudioScene } Current audio scene mode.
2928     * @syscap SystemCapability.Multimedia.Audio.Communication
2929     * @since 10
2930     */
2931    /**
2932     * Obtains the audio scene mode.
2933     * @returns { AudioScene } Current audio scene mode.
2934     * @syscap SystemCapability.Multimedia.Audio.Communication
2935     * @crossplatform
2936     * @since 12
2937     */
2938    getAudioSceneSync(): AudioScene;
2939
2940    /**
2941     * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive
2942     * the callback.
2943     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
2944     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
2945     * @syscap SystemCapability.Multimedia.Audio.Device
2946     * @since 7
2947     * @deprecated since 9
2948     * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange
2949     */
2950    on(type: 'deviceChange', callback: Callback<DeviceChangeAction>): void;
2951
2952    /**
2953     * UnSubscribes to device change events.
2954     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
2955     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
2956     * @syscap SystemCapability.Multimedia.Audio.Device
2957     * @since 7
2958     * @deprecated since 9
2959     * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange
2960     */
2961    off(type: 'deviceChange', callback?: Callback<DeviceChangeAction>): void;
2962
2963    /**
2964     * Listens for audio interruption events. When the audio of an application is interrupted by another application,
2965     * the callback is invoked to notify the former application.
2966     * @param { 'interrupt' } type - Type of the event to listen for. Only the interrupt event is supported.
2967     * @param { AudioInterrupt } interrupt - Parameters of the audio interruption event type.
2968     * @param { Callback<InterruptAction> } callback - Callback invoked for the audio interruption event.
2969     * @syscap SystemCapability.Multimedia.Audio.Renderer
2970     * @since 7
2971     * @deprecated since 11
2972     * @useinstead ohos.multimedia.audio.AudioRenderer#event:audioInterrupt
2973     */
2974    on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback<InterruptAction>): void;
2975
2976    /**
2977     * Cancels the listening of audio interruption events.
2978     * @param { 'interrupt' } type - Type of the event to listen for. Only the interrupt event is supported.
2979     * @param { AudioInterrupt } interrupt - Input parameters of the audio interruption event.
2980     * @param { Callback<InterruptAction> } callback - Callback invoked for the audio interruption event.
2981     * @syscap SystemCapability.Multimedia.Audio.Renderer
2982     * @since 7
2983     * @deprecated since 11
2984     * @useinstead ohos.multimedia.audio.AudioRenderer#event:audioInterrupt
2985     */
2986    off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback<InterruptAction>): void;
2987
2988    /**
2989     * Obtains an {@link AudioVolumeManager} instance.
2990     * @returns { AudioVolumeManager } AudioVolumeManager instance.
2991     * @syscap SystemCapability.Multimedia.Audio.Volume
2992     * @since 9
2993     */
2994    /**
2995     * Obtains an {@link AudioVolumeManager} instance.
2996     * @returns { AudioVolumeManager } AudioVolumeManager instance.
2997     * @syscap SystemCapability.Multimedia.Audio.Volume
2998     * @crossplatform
2999     * @since 12
3000     */
3001    getVolumeManager(): AudioVolumeManager;
3002
3003    /**
3004     * Obtains an {@link AudioStreamManager} instance.
3005     * @returns { AudioStreamManager } AudioStreamManager instance.
3006     * @syscap SystemCapability.Multimedia.Audio.Core
3007     * @since 9
3008     */
3009    /**
3010     * Obtains an {@link AudioStreamManager} instance.
3011     * @returns { AudioStreamManager } AudioStreamManager instance.
3012     * @syscap SystemCapability.Multimedia.Audio.Core
3013     * @crossplatform
3014     * @since 12
3015     */
3016    getStreamManager(): AudioStreamManager;
3017
3018    /**
3019     * Obtains an {@link AudioRoutingManager} instance.
3020     * @returns { AudioRoutingManager } AudioRoutingManager instance.
3021     * @syscap SystemCapability.Multimedia.Audio.Device
3022     * @since 9
3023     */
3024    /**
3025     * Obtains an {@link AudioRoutingManager} instance.
3026     * @returns { AudioRoutingManager } AudioRoutingManager instance.
3027     * @syscap SystemCapability.Multimedia.Audio.Device
3028     * @crossplatform
3029     * @since 12
3030     */
3031    getRoutingManager(): AudioRoutingManager;
3032
3033    /**
3034     * Obtains an {@link AudioSessionManager} instance.
3035     * @returns { AudioSessionManager } AudioSessionManager instance.
3036     * @syscap SystemCapability.Multimedia.Audio.Core
3037     * @crossplatform
3038     * @since 12
3039     */
3040    getSessionManager(): AudioSessionManager;
3041
3042    /**
3043     * Obtains an {@link AudioSpatializationManager} instance.
3044     * @returns { AudioSpatializationManager } AudioSpatializationManager instance.
3045     * @throws { BusinessError } 202 - Not system App.
3046     * @syscap SystemCapability.Multimedia.Audio.Spatialization
3047     * @systemapi
3048     * @since 11
3049     */
3050    getSpatializationManager(): AudioSpatializationManager;
3051
3052    /**
3053     * user disable the safe media volume state.
3054     * @permission ohos.permission.MODIFY_AUDIO_SETTINGS
3055     * @returns { Promise<void> } Promise used to return the result.
3056     * @throws { BusinessError } 201 - Permission denied.
3057     * @throws { BusinessError } 202 - Not system App.
3058     * @syscap SystemCapability.Multimedia.Audio.Core
3059     * @systemapi
3060     * @since 12
3061     */
3062    disableSafeMediaVolume(): Promise<void>;
3063  }
3064
3065  /**
3066   * Enumerates audio interrupt request result type.
3067   * @enum { number }
3068   * @syscap SystemCapability.Multimedia.Audio.Interrupt
3069   * @systemapi
3070   * @since 9
3071   */
3072  enum InterruptRequestResultType {
3073    /**
3074     * Request audio interrupt success
3075     * @syscap SystemCapability.Multimedia.Audio.Interrupt
3076     * @systemapi
3077     * @since 9
3078     */
3079    INTERRUPT_REQUEST_GRANT = 0,
3080    /**
3081     * Request audio interrupt fail, may have higher priority type
3082     * @syscap SystemCapability.Multimedia.Audio.Interrupt
3083     * @systemapi
3084     * @since 9
3085     */
3086    INTERRUPT_REQUEST_REJECT = 1
3087  }
3088
3089  /**
3090   * Describes audio interrupt operation results.
3091   * @typedef InterruptResult
3092   * @syscap SystemCapability.Multimedia.Audio.Interrupt
3093   * @systemapi
3094   * @since 9
3095   */
3096  interface InterruptResult {
3097    /**
3098     * Interrupt request or abandon result.
3099     * @type { InterruptRequestResultType }
3100     * @syscap SystemCapability.Multimedia.Audio.Interrupt
3101     * @systemapi
3102     * @since 9
3103     */
3104    requestResult: InterruptRequestResultType;
3105    /**
3106     * Interrupt node as a unit to receive interrupt change event.
3107     * @type { number }
3108     * @syscap SystemCapability.Multimedia.Audio.Interrupt
3109     * @systemapi
3110     * @since 9
3111     */
3112    interruptNode: number;
3113  }
3114
3115  /**
3116   * Desribes audio device block status. By default, the device is consider as unblocked.
3117   * @enum { number }
3118   * @syscap SystemCapability.Multimedia.Audio.Device
3119   * @since 13
3120   */
3121  enum DeviceBlockStatus {
3122    /**
3123     * Device is unblocked.
3124     * @syscap SystemCapability.Multimedia.Audio.Device
3125     * @since 13
3126     */
3127    UNBLOCKED = 0,
3128    /**
3129     * Device is blocked.
3130     * @syscap SystemCapability.Multimedia.Audio.Device
3131     * @since 13
3132     */
3133    BLOCKED = 1,
3134  }
3135
3136  /**
3137   * Desribes audio device block status info.
3138   * @typedef DeviceBlockStatusInfo
3139   * @syscap SystemCapability.Multimedia.Audio.Device
3140   * @since 13
3141   */
3142  interface DeviceBlockStatusInfo {
3143    /**
3144     * Device block status.
3145     * @type {DeviceBlockStatus}
3146     * @syscap SystemCapability.Multimedia.Audio.Device
3147     * @since 13
3148     */
3149    blockStatus: DeviceBlockStatus;
3150
3151    /**
3152     * Audio device descriptors whose block status has changed.
3153     * @type {AudioDeviceDescriptors}
3154     * @syscap SystemCapability.Multimedia.Audio.Device
3155     * @since 13
3156     */
3157    devices: AudioDeviceDescriptors;
3158  }
3159
3160  /**
3161   * Implements audio router management.
3162   * @typedef AudioRoutingManager
3163   * @syscap SystemCapability.Multimedia.Audio.Device
3164   * @since 9
3165   */
3166  /**
3167   * Implements audio router management.
3168   * @typedef AudioRoutingManager
3169   * @syscap SystemCapability.Multimedia.Audio.Device
3170   * @crossplatform
3171   * @since 12
3172   */
3173  interface AudioRoutingManager {
3174    /**
3175     * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result.
3176     * @param { DeviceFlag } deviceFlag - Audio device flag.
3177     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the device list.
3178     * @syscap SystemCapability.Multimedia.Audio.Device
3179     * @since 9
3180     */
3181    /**
3182     * Obtains the audio devices with a specific flag. This method uses an asynchronous callback to return the query result.
3183     * @param { DeviceFlag } deviceFlag - Audio device flag.
3184     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the device list.
3185     * @syscap SystemCapability.Multimedia.Audio.Device
3186     * @crossplatform
3187     * @since 12
3188     */
3189    getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback<AudioDeviceDescriptors>): void;
3190    /**
3191     * Obtains the audio devices with a specific flag. This method uses a promise to return the query result.
3192     * @param { DeviceFlag } deviceFlag - Audio device flag.
3193     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the device list.
3194     * @syscap SystemCapability.Multimedia.Audio.Device
3195     * @since 9
3196     */
3197    /**
3198     * Obtains the audio devices with a specific flag. This method uses a promise to return the query result.
3199     * @param { DeviceFlag } deviceFlag - Audio device flag.
3200     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the device list.
3201     * @syscap SystemCapability.Multimedia.Audio.Device
3202     * @crossplatform
3203     * @since 12
3204     */
3205    getDevices(deviceFlag: DeviceFlag): Promise<AudioDeviceDescriptors>;
3206    /**
3207     * Obtains the audio devices with a specific flag.
3208     * @param { DeviceFlag } deviceFlag - Audio device flag.
3209     * @returns { AudioDeviceDescriptors } The device list.
3210     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3211     *                                 1.Mandatory parameters are left unspecified;
3212     *                                 2.Incorrect parameter types.
3213     * @throws { BusinessError } 6800101 - Parameter verification failed.
3214     * @syscap SystemCapability.Multimedia.Audio.Device
3215     * @since 10
3216     */
3217    /**
3218     * Obtains the audio devices with a specific flag.
3219     * @param { DeviceFlag } deviceFlag - Audio device flag.
3220     * @returns { AudioDeviceDescriptors } The device list.
3221     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3222     *                                 1.Mandatory parameters are left unspecified;
3223     *                                 2.Incorrect parameter types.
3224     * @throws { BusinessError } 6800101 - Parameter verification failed.
3225     * @syscap SystemCapability.Multimedia.Audio.Device
3226     * @crossplatform
3227     * @since 12
3228     */
3229    getDevicesSync(deviceFlag: DeviceFlag): AudioDeviceDescriptors;
3230
3231    /**
3232     * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive
3233     * the callback.
3234     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
3235     * @param { DeviceFlag } deviceFlag - Audio device flag.
3236     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3237     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3238     *                                 1.Mandatory parameters are left unspecified;
3239     *                                 2.Incorrect parameter types.
3240     * @throws { BusinessError } 6800101 - Parameter verification failed.
3241     * @syscap SystemCapability.Multimedia.Audio.Device
3242     * @since 9
3243     */
3244    /**
3245     * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive
3246     * the callback.
3247     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
3248     * @param { DeviceFlag } deviceFlag - Audio device flag.
3249     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3250     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3251     *                                 1.Mandatory parameters are left unspecified;
3252     *                                 2.Incorrect parameter types.
3253     * @throws { BusinessError } 6800101 - Parameter verification failed.
3254     * @syscap SystemCapability.Multimedia.Audio.Device
3255     * @crossplatform
3256     * @since 12
3257     */
3258    on(type: 'deviceChange', deviceFlag: DeviceFlag, callback: Callback<DeviceChangeAction>): void;
3259
3260    /**
3261     * UnSubscribes to device change events.
3262     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
3263     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3264     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3265     *                                 1.Mandatory parameters are left unspecified;
3266     *                                 2.Incorrect parameter types.
3267     * @throws { BusinessError } 6800101 - Parameter verification failed.
3268     * @syscap SystemCapability.Multimedia.Audio.Device
3269     * @since 9
3270     */
3271    /**
3272     * UnSubscribes to device change events.
3273     * @param { 'deviceChange' } type - Type of the event to listen for. Only the deviceChange event is supported.
3274     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3275     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3276     *                                 1.Mandatory parameters are left unspecified;
3277     *                                 2.Incorrect parameter types.
3278     * @throws { BusinessError } 6800101 - Parameter verification failed.
3279     * @syscap SystemCapability.Multimedia.Audio.Device
3280     * @crossplatform
3281     * @since 12
3282     */
3283    off(type: 'deviceChange', callback?: Callback<DeviceChangeAction>): void;
3284
3285    /**
3286     * Obtains all the available audio devices with a specific device usage.
3287     * @param { DeviceUsage } deviceUsage - Audio device usage.
3288     * @returns { AudioDeviceDescriptors } The device list.
3289     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3290     *                                 1.Mandatory parameters are left unspecified;
3291     *                                 2.Incorrect parameter types.
3292     * @throws { BusinessError } 6800101 - Parameter verification failed.
3293     * @syscap SystemCapability.Multimedia.Audio.Device
3294     * @since 12
3295     */
3296    getAvailableDevices(deviceUsage: DeviceUsage): AudioDeviceDescriptors;
3297
3298    /**
3299     * Subscribes to available device change events. When a device is connected/disconnected, registered clients will receive
3300     * the callback.
3301     * @param { 'availableDeviceChange' } type - Type of the event to listen for. Only the availableDeviceChange event is supported.
3302     * @param { DeviceUsage } deviceUsage - Audio device usage.
3303     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3304     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3305     *                                 1.Mandatory parameters are left unspecified;
3306     *                                 2.Incorrect parameter types.
3307     * @throws { BusinessError } 6800101 - Parameter verification failed.
3308     * @syscap SystemCapability.Multimedia.Audio.Device
3309     * @since 12
3310     */
3311    on(type: 'availableDeviceChange', deviceUsage: DeviceUsage, callback: Callback<DeviceChangeAction>): void;
3312
3313    /**
3314     * UnSubscribes to available device change events.
3315     * @param { 'availableDeviceChange' } type - Type of the event to listen for. Only the availableDeviceChange event is supported.
3316     * @param { Callback<DeviceChangeAction> } callback - Callback used to obtain the device update details.
3317     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3318     *                                 1.Mandatory parameters are left unspecified;
3319     *                                 2.Incorrect parameter types.
3320     * @throws { BusinessError } 6800101 - Parameter verification failed.
3321     * @syscap SystemCapability.Multimedia.Audio.Device
3322     * @since 12
3323     */
3324    off(type: 'availableDeviceChange', callback?: Callback<DeviceChangeAction>): void;
3325
3326    /**
3327     * Sets a device to the active state. This method uses an asynchronous callback to return the result.
3328     * @param { CommunicationDeviceType } deviceType - Audio device type.
3329     * @param { boolean } active - Active status to set. The value true means to set the device to
3330     *  the active status, and false means the opposite.
3331     * @param { AsyncCallback<void> } callback - Callback used to return the result.
3332     * @syscap SystemCapability.Multimedia.Audio.Communication
3333     * @since 9
3334     */
3335    /**
3336     * Sets a device to the active state. This method uses an asynchronous callback to return the result.
3337     * @param { CommunicationDeviceType } deviceType - Audio device type.
3338     * @param { boolean } active - Active status to set. The value true means to set the device to
3339     *  the active status, and false means the opposite.
3340     * @param { AsyncCallback<void> } callback - Callback used to return the result.
3341     * @syscap SystemCapability.Multimedia.Audio.Communication
3342     * @crossplatform
3343     * @since 12
3344     */
3345    setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean, callback: AsyncCallback<void>): void;
3346    /**
3347     * Sets a device to the active state. This method uses a promise to return the result.
3348     * @param { CommunicationDeviceType } deviceType - Audio device type.
3349     * @param { boolean } active - Active status to set. The value true means to set the device to the active status,
3350     * and false means the opposite.
3351     * @returns { Promise<void> } Promise used to return the result.
3352     * @syscap SystemCapability.Multimedia.Audio.Communication
3353     * @since 9
3354     */
3355    /**
3356     * Sets a device to the active state. This method uses a promise to return the result.
3357     * @param { CommunicationDeviceType } deviceType - Audio device type.
3358     * @param { boolean } active - Active status to set. The value true means to set the device to the active status,
3359     * and false means the opposite.
3360     * @returns { Promise<void> } Promise used to return the result.
3361     * @syscap SystemCapability.Multimedia.Audio.Communication
3362     * @crossplatform
3363     * @since 12
3364     */
3365    setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean): Promise<void>;
3366
3367    /**
3368     * Checks whether a device is active. This method uses an asynchronous callback to return the query result.
3369     * @param { CommunicationDeviceType } deviceType - Audio device type.
3370     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the device.
3371     * @syscap SystemCapability.Multimedia.Audio.Communication
3372     * @since 9
3373     */
3374    /**
3375     * Checks whether a device is active. This method uses an asynchronous callback to return the query result.
3376     * @param { CommunicationDeviceType } deviceType - Audio device type.
3377     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the device.
3378     * @syscap SystemCapability.Multimedia.Audio.Communication
3379     * @crossplatform
3380     * @since 12
3381     */
3382    isCommunicationDeviceActive(deviceType: CommunicationDeviceType, callback: AsyncCallback<boolean>): void;
3383    /**
3384     * Checks whether a device is active. This method uses a promise to return the query result.
3385     * @param { CommunicationDeviceType } deviceType - Audio device type.
3386     * @returns { Promise<boolean> } Promise used to return the active status of the device.
3387     * @syscap SystemCapability.Multimedia.Audio.Communication
3388     * @since 9
3389     */
3390    /**
3391     * Checks whether a device is active. This method uses a promise to return the query result.
3392     * @param { CommunicationDeviceType } deviceType - Audio device type.
3393     * @returns { Promise<boolean> } Promise used to return the active status of the device.
3394     * @syscap SystemCapability.Multimedia.Audio.Communication
3395     * @crossplatform
3396     * @since 12
3397     */
3398    isCommunicationDeviceActive(deviceType: CommunicationDeviceType): Promise<boolean>;
3399    /**
3400     * Checks whether a device is active.
3401     * @param { CommunicationDeviceType } deviceType - Audio device type.
3402     * @returns { boolean } The active status of the device.
3403     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3404     *                                 1.Mandatory parameters are left unspecified;
3405     *                                 2.Incorrect parameter types.
3406     * @throws { BusinessError } 6800101 - Parameter verification failed.
3407     * @syscap SystemCapability.Multimedia.Audio.Communication
3408     * @since 10
3409     */
3410    /**
3411     * Checks whether a device is active.
3412     * @param { CommunicationDeviceType } deviceType - Audio device type.
3413     * @returns { boolean } The active status of the device.
3414     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3415     *                                 1.Mandatory parameters are left unspecified;
3416     *                                 2.Incorrect parameter types.
3417     * @throws { BusinessError } 6800101 - Parameter verification failed.
3418     * @syscap SystemCapability.Multimedia.Audio.Communication
3419     * @crossplatform
3420     * @since 12
3421     */
3422    isCommunicationDeviceActiveSync(deviceType: CommunicationDeviceType): boolean;
3423
3424    /**
3425     * Select the output device. This method uses an asynchronous callback to return the result.
3426     * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description
3427     * @param { AsyncCallback<void> } callback - Callback used to return the result.
3428     * @syscap SystemCapability.Multimedia.Audio.Device
3429     * @systemapi
3430     * @since 9
3431     */
3432    selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback<void>): void;
3433    /**
3434     * Select the output device. This method uses a promise to return the result.
3435     * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description
3436     * @returns { Promise<void> } Promise used to return the result.
3437     * @syscap SystemCapability.Multimedia.Audio.Device
3438     * @systemapi
3439     * @since 9
3440     */
3441    selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise<void>;
3442
3443    /**
3444     * Select the output device with desired AudioRenderer. This method uses an asynchronous callback to return the result.
3445     * @param { AudioRendererFilter } filter - Filter for AudioRenderer.
3446     * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description.
3447     * @param { AsyncCallback<void> } callback - Callback used to return the result.
3448     * @syscap SystemCapability.Multimedia.Audio.Device
3449     * @systemapi
3450     * @since 9
3451     */
3452    selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback<void>): void;
3453    /**
3454     * Select the output device with desired AudioRenderer. This method uses a promise to return the result.
3455     * @param { AudioRendererFilter } filter - Filter for AudioRenderer.
3456     * @param { AudioDeviceDescriptors } outputAudioDevices - Audio device description
3457     * @returns { Promise<void> } Promise used to return the result.
3458     * @syscap SystemCapability.Multimedia.Audio.Device
3459     * @systemapi
3460     * @since 9
3461     */
3462    selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: AudioDeviceDescriptors): Promise<void>;
3463
3464    /**
3465     * Select the input device. This method uses an asynchronous callback to return the result.
3466     * @param { AudioDeviceDescriptors } inputAudioDevices - Audio device description
3467     * @param { AsyncCallback<void> } callback - Callback used to return the result.
3468     * @syscap SystemCapability.Multimedia.Audio.Device
3469     * @systemapi
3470     * @since 9
3471     */
3472    selectInputDevice(inputAudioDevices: AudioDeviceDescriptors, callback: AsyncCallback<void>): void;
3473    /**
3474     * Select the input device. This method uses a promise to return the result.
3475     * @param { AudioDeviceDescriptors } inputAudioDevices - Audio device description
3476     * @returns { Promise<void> } Promise used to return the result.
3477     * @syscap SystemCapability.Multimedia.Audio.Device
3478     * @systemapi
3479     * @since 9
3480     */
3481    selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise<void>;
3482
3483    /**
3484     * Get output device for target audio renderer info.
3485     * @param { AudioRendererInfo } rendererInfo - Audio renderer information
3486     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
3487     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3488     *                                 1.Mandatory parameters are left unspecified;
3489     *                                 2.Incorrect parameter types.
3490     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
3491     * @throws { BusinessError } 6800301 - System error. Return by callback.
3492     * @syscap SystemCapability.Multimedia.Audio.Device
3493     * @since 10
3494     */
3495    /**
3496     * Get output device for target audio renderer info.
3497     * @param { AudioRendererInfo } rendererInfo - Audio renderer information
3498     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
3499     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3500     *                                 1.Mandatory parameters are left unspecified;
3501     *                                 2.Incorrect parameter types.
3502     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
3503     * @throws { BusinessError } 6800301 - System error. Return by callback.
3504     * @syscap SystemCapability.Multimedia.Audio.Device
3505     * @crossplatform
3506     * @since 12
3507     */
3508    getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo, callback: AsyncCallback<AudioDeviceDescriptors>): void;
3509    /**
3510     * Get output device for target audio renderer info.
3511     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3512     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
3513     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3514     *                                 1.Mandatory parameters are left unspecified;
3515     *                                 2.Incorrect parameter types.
3516     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
3517     * @throws { BusinessError } 6800301 - System error. Return by promise.
3518     * @syscap SystemCapability.Multimedia.Audio.Device
3519     * @since 10
3520     */
3521    /**
3522     * Get output device for target audio renderer info.
3523     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3524     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
3525     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3526     *                                 1.Mandatory parameters are left unspecified;
3527     *                                 2.Incorrect parameter types.
3528     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
3529     * @throws { BusinessError } 6800301 - System error. Return by promise.
3530     * @syscap SystemCapability.Multimedia.Audio.Device
3531     * @crossplatform
3532     * @since 12
3533     */
3534    getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo): Promise<AudioDeviceDescriptors>;
3535
3536    /**
3537     * Gets preferred output device for target audio renderer info.
3538     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3539     * @returns { AudioDeviceDescriptors } The preferred devices.
3540     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3541     *                                 1.Mandatory parameters are left unspecified;
3542     *                                 2.Incorrect parameter types.
3543     * @throws { BusinessError } 6800101 - Parameter verification failed.
3544     * @syscap SystemCapability.Multimedia.Audio.Device
3545     * @since 10
3546     */
3547    /**
3548     * Gets preferred output device for target audio renderer info.
3549     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3550     * @returns { AudioDeviceDescriptors } The preferred devices.
3551     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3552     *                                 1.Mandatory parameters are left unspecified;
3553     *                                 2.Incorrect parameter types.
3554     * @throws { BusinessError } 6800101 - Parameter verification failed.
3555     * @syscap SystemCapability.Multimedia.Audio.Device
3556     * @crossplatform
3557     * @since 12
3558     */
3559    getPreferredOutputDeviceForRendererInfoSync(rendererInfo: AudioRendererInfo): AudioDeviceDescriptors;
3560
3561    /**
3562     * Subscribes to prefer output device change events. When prefer device for target audio renderer info changes,
3563     * registered clients will receive the callback.
3564     * @param { 'preferOutputDeviceChangeForRendererInfo' } type - Type of the event to listen for. Only the
3565     * preferOutputDeviceChangeForRendererInfo event is supported.
3566     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3567     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed prefer devices information.
3568     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3569     *                                 1.Mandatory parameters are left unspecified;
3570     *                                 2.Incorrect parameter types.
3571     * @throws { BusinessError } 6800101 - Parameter verification failed.
3572     * @syscap SystemCapability.Multimedia.Audio.Device
3573     * @since 10
3574     */
3575    /**
3576     * Subscribes to prefer output device change events. When prefer device for target audio renderer info changes,
3577     * registered clients will receive the callback.
3578     * @param { 'preferOutputDeviceChangeForRendererInfo' } type - Type of the event to listen for. Only the
3579     * preferOutputDeviceChangeForRendererInfo event is supported.
3580     * @param { AudioRendererInfo } rendererInfo - Audio renderer information.
3581     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed prefer devices information.
3582     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3583     *                                 1.Mandatory parameters are left unspecified;
3584     *                                 2.Incorrect parameter types.
3585     * @throws { BusinessError } 6800101 - Parameter verification failed.
3586     * @syscap SystemCapability.Multimedia.Audio.Device
3587     * @crossplatform
3588     * @since 12
3589     */
3590    on(type: 'preferOutputDeviceChangeForRendererInfo', rendererInfo: AudioRendererInfo, callback: Callback<AudioDeviceDescriptors>): void;
3591    /**
3592     * UnSubscribes to prefer output device change events.
3593     * @param { 'preferOutputDeviceChangeForRendererInfo' } type - Type of the event to listen for. Only the
3594     * preferOutputDeviceChangeForRendererInfo event is supported.
3595     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed prefer devices in subscribe.
3596     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3597     *                                 1.Mandatory parameters are left unspecified;
3598     *                                 2.Incorrect parameter types.
3599     * @throws { BusinessError } 6800101 - Parameter verification failed.
3600     * @syscap SystemCapability.Multimedia.Audio.Device
3601     * @since 10
3602     */
3603    /**
3604     * UnSubscribes to prefer output device change events.
3605     * @param { 'preferOutputDeviceChangeForRendererInfo' } type - Type of the event to listen for. Only the
3606     * preferOutputDeviceChangeForRendererInfo event is supported.
3607     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed prefer devices in subscribe.
3608     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3609     *                                 1.Mandatory parameters are left unspecified;
3610     *                                 2.Incorrect parameter types.
3611     * @throws { BusinessError } 6800101 - Parameter verification failed.
3612     * @syscap SystemCapability.Multimedia.Audio.Device
3613     * @crossplatform
3614     * @since 12
3615     */
3616    off(type: 'preferOutputDeviceChangeForRendererInfo', callback?: Callback<AudioDeviceDescriptors>): void;
3617
3618    /**
3619     * Get input device for target audio capturer info.
3620     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3621     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
3622     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3623     *                                 1.Mandatory parameters are left unspecified;
3624     *                                 2.Incorrect parameter types.
3625     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
3626     * @throws { BusinessError } 6800301 - System error. Return by callback.
3627     * @syscap SystemCapability.Multimedia.Audio.Device
3628     * @since 10
3629     */
3630    /**
3631     * Get input device for target audio capturer info.
3632     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3633     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
3634     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3635     *                                 1.Mandatory parameters are left unspecified;
3636     *                                 2.Incorrect parameter types.
3637     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
3638     * @throws { BusinessError } 6800301 - System error. Return by callback.
3639     * @syscap SystemCapability.Multimedia.Audio.Device
3640     * @crossplatform
3641     * @since 12
3642     */
3643    getPreferredInputDeviceForCapturerInfo(capturerInfo: AudioCapturerInfo, callback: AsyncCallback<AudioDeviceDescriptors>): void;
3644    /**
3645     * Get input device for target audio capturer info.
3646     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3647     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
3648     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3649     *                                 1.Mandatory parameters are left unspecified;
3650     *                                 2.Incorrect parameter types.
3651     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
3652     * @throws { BusinessError } 6800301 - System error. Return by promise.
3653     * @syscap SystemCapability.Multimedia.Audio.Device
3654     * @since 10
3655     */
3656    /**
3657     * Get input device for target audio capturer info.
3658     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3659     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
3660     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3661     *                                 1.Mandatory parameters are left unspecified;
3662     *                                 2.Incorrect parameter types.
3663     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
3664     * @throws { BusinessError } 6800301 - System error. Return by promise.
3665     * @syscap SystemCapability.Multimedia.Audio.Device
3666     * @crossplatform
3667     * @since 12
3668     */
3669    getPreferredInputDeviceForCapturerInfo(capturerInfo: AudioCapturerInfo): Promise<AudioDeviceDescriptors>;
3670
3671    /**
3672     * Subscribes to preferred input device change events. When preferred device for target audio capturer info changes,
3673     * registered clients will receive the callback.
3674     * @param { 'preferredInputDeviceChangeForCapturerInfo' } type - Type of the event to listen for.
3675     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3676     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed preferred devices information.
3677     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3678     *                                 1.Mandatory parameters are left unspecified;
3679     *                                 2.Incorrect parameter types.
3680     * @throws { BusinessError } 6800101 - Parameter verification failed.
3681     * @syscap SystemCapability.Multimedia.Audio.Device
3682     * @since 10
3683     */
3684    /**
3685     * Subscribes to preferred input device change events. When preferred device for target audio capturer info changes,
3686     * registered clients will receive the callback.
3687     * @param { 'preferredInputDeviceChangeForCapturerInfo' } type - Type of the event to listen for.
3688     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3689     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed preferred devices information.
3690     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3691     *                                 1.Mandatory parameters are left unspecified;
3692     *                                 2.Incorrect parameter types.
3693     * @throws { BusinessError } 6800101 - Parameter verification failed.
3694     * @syscap SystemCapability.Multimedia.Audio.Device
3695     * @crossplatform
3696     * @since 12
3697     */
3698    on(type: 'preferredInputDeviceChangeForCapturerInfo', capturerInfo: AudioCapturerInfo, callback: Callback<AudioDeviceDescriptors>): void;
3699    /**
3700     * Unsubscribes to preferred input device change events.
3701     * @param { 'preferredInputDeviceChangeForCapturerInfo' } type - Type of the event to listen for.
3702     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed preferred devices in subscribe.
3703     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3704     *                                 1.Mandatory parameters are left unspecified;
3705     *                                 2.Incorrect parameter types.
3706     * @throws { BusinessError } 6800101 - Parameter verification failed.
3707     * @syscap SystemCapability.Multimedia.Audio.Device
3708     * @since 10
3709     */
3710    /**
3711     * Unsubscribes to preferred input device change events.
3712     * @param { 'preferredInputDeviceChangeForCapturerInfo' } type - Type of the event to listen for.
3713     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to obtain the changed preferred devices in subscribe.
3714     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3715     *                                 1.Mandatory parameters are left unspecified;
3716     *                                 2.Incorrect parameter types.
3717     * @throws { BusinessError } 6800101 - Parameter verification failed.
3718     * @syscap SystemCapability.Multimedia.Audio.Device
3719     * @crossplatform
3720     * @since 12
3721     */
3722    off(type: 'preferredInputDeviceChangeForCapturerInfo', callback?: Callback<AudioDeviceDescriptors>): void;
3723
3724    /**
3725     * Gets preferred input device for target audio capturer info.
3726     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3727     * @returns { AudioDeviceDescriptors } The preferred devices.
3728     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3729     *                                 1.Mandatory parameters are left unspecified;
3730     *                                 2.Incorrect parameter types.
3731     * @throws { BusinessError } 6800101 - Parameter verification failed.
3732     * @syscap SystemCapability.Multimedia.Audio.Device
3733     * @since 10
3734     */
3735    /**
3736     * Gets preferred input device for target audio capturer info.
3737     * @param { AudioCapturerInfo } capturerInfo - Audio capturer information.
3738     * @returns { AudioDeviceDescriptors } The preferred devices.
3739     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3740     *                                 1.Mandatory parameters are left unspecified;
3741     *                                 2.Incorrect parameter types.
3742     * @throws { BusinessError } 6800101 - Parameter verification failed.
3743     * @syscap SystemCapability.Multimedia.Audio.Device
3744     * @crossplatform
3745     * @since 12
3746     */
3747    getPreferredInputDeviceForCapturerInfoSync(capturerInfo: AudioCapturerInfo): AudioDeviceDescriptors;
3748
3749    /**
3750     * Query whether microphone block detection is supported on current device.
3751     * @returns { Promise<boolean> } Promise used to return the result.
3752     * @syscap SystemCapability.Multimedia.Audio.Device
3753     * @since 13
3754     */
3755    isMicBlockDetectionSupported():Promise<boolean>;
3756
3757    /**
3758     * Subscribes microphone blocked events. Before subscribing, users should query whether block detection is supported
3759     * on current device. The caller will receive the callback only when it is recording and the used
3760     * microphones' block status have changed. Currently, block detecting is only support for microphones located on
3761     * the local device.
3762     * @param { 'micBlockStatusChanged' } type - Type of the event to listen for.
3763     * @param { Callback<DeviceBlockStatusInfo> } callback - Callback used to obtain the microphone block status.
3764     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3765     *                                 1.Mandatory parameters are left unspecified;
3766     *                                 2.Incorrect parameter types.
3767     * @throws { BusinessError } 6800101 - Parameter verification failed.
3768     * @syscap SystemCapability.Multimedia.Audio.Device
3769     * @since 13
3770     */
3771    on(type: 'micBlockStatusChanged', callback: Callback<DeviceBlockStatusInfo>): void;
3772
3773    /**
3774     * Unsubscribes microphone blocked events.
3775     * @param { 'microphoneBlockStatusChanged' } type - Type of the event to listen for.
3776     * @param { Callback<DeviceBlockStatusInfo> } callback - Callback used to obtain the microphone block status.
3777     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3778     *                                 1.Mandatory parameters are left unspecified;
3779     *                                 2.Incorrect parameter types.
3780     * @throws { BusinessError } 6800101 - Parameter verification failed.
3781     * @syscap SystemCapability.Multimedia.Audio.Device
3782     * @since 13
3783     */
3784     off(type: 'micBlockStatusChanged', callback?: Callback<DeviceBlockStatusInfo>): void;
3785  }
3786
3787  /**
3788   * Implements audio stream management.
3789   * @typedef AudioStreamManager
3790   * @syscap SystemCapability.Multimedia.Audio.Core
3791   * @since 9
3792   */
3793  /**
3794   * Implements audio stream management.
3795   * @typedef AudioStreamManager
3796   * @syscap SystemCapability.Multimedia.Audio.Core
3797   * @crossplatform
3798   * @since 12
3799   */
3800  interface AudioStreamManager {
3801    /**
3802     * Get information of current existing audio renderers.
3803     * @param { AsyncCallback<AudioRendererChangeInfoArray> } callback - Callback used to return the information
3804     * of current existing audio renderers.
3805     * @syscap SystemCapability.Multimedia.Audio.Renderer
3806     * @since 9
3807     */
3808    /**
3809     * Get information of current existing audio renderers.
3810     * @param { AsyncCallback<AudioRendererChangeInfoArray> } callback - Callback used to return the information
3811     * of current existing audio renderers.
3812     * @syscap SystemCapability.Multimedia.Audio.Renderer
3813     * @crossplatform
3814     * @since 12
3815     */
3816    getCurrentAudioRendererInfoArray(callback: AsyncCallback<AudioRendererChangeInfoArray>): void;
3817    /**
3818     * Get information of current existing audio renderers.
3819     * @returns { Promise<AudioRendererChangeInfoArray> } Promise used to return the information of current
3820     * existing audio renderers.
3821     * @syscap SystemCapability.Multimedia.Audio.Renderer
3822     * @since 9
3823     */
3824    /**
3825     * Get information of current existing audio renderers.
3826     * @returns { Promise<AudioRendererChangeInfoArray> } Promise used to return the information of current
3827     * existing audio renderers.
3828     * @syscap SystemCapability.Multimedia.Audio.Renderer
3829     * @crossplatform
3830     * @since 12
3831     */
3832    getCurrentAudioRendererInfoArray(): Promise<AudioRendererChangeInfoArray>;
3833    /**
3834     * Get information of current existing audio renderers.
3835     * @returns { AudioRendererChangeInfoArray } The information of current existing audio renderers.
3836     * @syscap SystemCapability.Multimedia.Audio.Renderer
3837     * @since 10
3838     */
3839    /**
3840     * Get information of current existing audio renderers.
3841     * @returns { AudioRendererChangeInfoArray } The information of current existing audio renderers.
3842     * @syscap SystemCapability.Multimedia.Audio.Renderer
3843     * @crossplatform
3844     * @since 12
3845     */
3846    getCurrentAudioRendererInfoArraySync(): AudioRendererChangeInfoArray;
3847
3848    /**
3849     * Get information of current existing audio capturers.
3850     * @param { AsyncCallback<AudioCapturerChangeInfoArray> } callback - Callback used to return the information
3851     * of current existing audio capturers.
3852     * @syscap SystemCapability.Multimedia.Audio.Renderer
3853     * @since 9
3854     */
3855    /**
3856     * Get information of current existing audio capturers.
3857     * @param { AsyncCallback<AudioCapturerChangeInfoArray> } callback - Callback used to return the information
3858     * of current existing audio capturers.
3859     * @syscap SystemCapability.Multimedia.Audio.Renderer
3860     * @crossplatform
3861     * @since 12
3862     */
3863    getCurrentAudioCapturerInfoArray(callback: AsyncCallback<AudioCapturerChangeInfoArray>): void;
3864    /**
3865     * Get information of current existing audio capturers.
3866     * @returns { Promise<AudioCapturerChangeInfoArray> } Promise used to return the information of current existing
3867     * audio capturers.
3868     * @syscap SystemCapability.Multimedia.Audio.Renderer
3869     * @since 9
3870     */
3871    /**
3872     * Get information of current existing audio capturers.
3873     * @returns { Promise<AudioCapturerChangeInfoArray> } Promise used to return the information of current existing
3874     * audio capturers.
3875     * @syscap SystemCapability.Multimedia.Audio.Renderer
3876     * @crossplatform
3877     * @since 12
3878     */
3879    getCurrentAudioCapturerInfoArray(): Promise<AudioCapturerChangeInfoArray>;
3880    /**
3881     * Get information of current existing audio capturers.
3882     * @returns { AudioCapturerChangeInfoArray } The information of current existing audio capturers.
3883     * @syscap SystemCapability.Multimedia.Audio.Capturer
3884     * @since 10
3885     */
3886    /**
3887     * Get information of current existing audio capturers.
3888     * @returns { AudioCapturerChangeInfoArray } The information of current existing audio capturers.
3889     * @syscap SystemCapability.Multimedia.Audio.Capturer
3890     * @crossplatform
3891     * @since 12
3892     */
3893    getCurrentAudioCapturerInfoArraySync(): AudioCapturerChangeInfoArray;
3894
3895    /**
3896     * Gets information of audio effects.
3897     * @param { StreamUsage } usage - Stream usage.
3898     * @param { AsyncCallback<AudioEffectInfoArray> } callback - Callback used to return the information of audio effects.
3899     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3900     *                                 1.Mandatory parameters are left unspecified;
3901     *                                 2.Incorrect parameter types.
3902     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
3903     * @syscap SystemCapability.Multimedia.Audio.Renderer
3904     * @since 10
3905     */
3906    getAudioEffectInfoArray(usage: StreamUsage, callback: AsyncCallback<AudioEffectInfoArray>): void;
3907    /**
3908     * Gets information of audio effects.
3909     * @param { StreamUsage } usage - Stream usage.
3910     * @returns { Promise<AudioEffectInfoArray> } Promise used to return the information of audio effects.
3911     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3912     *                                 1.Mandatory parameters are left unspecified;
3913     *                                 2.Incorrect parameter types.
3914     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
3915     * @syscap SystemCapability.Multimedia.Audio.Renderer
3916     * @since 10
3917     */
3918    getAudioEffectInfoArray(usage: StreamUsage): Promise<AudioEffectInfoArray>;
3919    /**
3920     * Gets information of audio effects.
3921     * @param { StreamUsage } usage - Stream usage.
3922     * @returns { AudioEffectInfoArray } The information of audio effects.
3923     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3924     *                                 1.Mandatory parameters are left unspecified;
3925     *                                 2.Incorrect parameter types.
3926     * @throws { BusinessError } 6800101 - Parameter verification failed.
3927     * @syscap SystemCapability.Multimedia.Audio.Renderer
3928     * @since 10
3929     */
3930    getAudioEffectInfoArraySync(usage: StreamUsage): AudioEffectInfoArray;
3931
3932    /**
3933     * Listens for audio renderer change events. When there is any audio renderer change,
3934     * registered clients will receive the callback.
3935     * @param { 'audioRendererChange' } type - Type of the event to listen for. Only the audioRendererChange event is supported.
3936     * @param { Callback<AudioRendererChangeInfoArray> } callback - Callback invoked for the audio renderer change event.
3937     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3938     *                                 1.Mandatory parameters are left unspecified;
3939     *                                 2.Incorrect parameter types.
3940     * @throws { BusinessError } 6800101 - Parameter verification failed.
3941     * @syscap SystemCapability.Multimedia.Audio.Renderer
3942     * @since 9
3943     */
3944    /**
3945     * Listens for audio renderer change events. When there is any audio renderer change,
3946     * registered clients will receive the callback.
3947     * @param { 'audioRendererChange' } type - Type of the event to listen for. Only the audioRendererChange event is supported.
3948     * @param { Callback<AudioRendererChangeInfoArray> } callback - Callback invoked for the audio renderer change event.
3949     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3950     *                                 1.Mandatory parameters are left unspecified;
3951     *                                 2.Incorrect parameter types.
3952     * @throws { BusinessError } 6800101 - Parameter verification failed.
3953     * @syscap SystemCapability.Multimedia.Audio.Renderer
3954     * @crossplatform
3955     * @since 12
3956     */
3957    on(type: 'audioRendererChange', callback: Callback<AudioRendererChangeInfoArray>): void;
3958
3959    /**
3960     * UnSubscribes to audio renderer change events.
3961     * @param { 'audioRendererChange' } type - Type of the event to listen for. Only the audioRendererChange event is supported.
3962     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3963     *                                 1.Mandatory parameters are left unspecified;
3964     *                                 2.Incorrect parameter types.
3965     * @throws { BusinessError } 6800101 - Parameter verification failed.
3966     * @syscap SystemCapability.Multimedia.Audio.Renderer
3967     * @since 9
3968     */
3969    /**
3970     * UnSubscribes to audio renderer change events.
3971     * @param { 'audioRendererChange' } type - Type of the event to listen for. Only the audioRendererChange event is supported.
3972     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3973     *                                 1.Mandatory parameters are left unspecified;
3974     *                                 2.Incorrect parameter types.
3975     * @throws { BusinessError } 6800101 - Parameter verification failed.
3976     * @syscap SystemCapability.Multimedia.Audio.Renderer
3977     * @crossplatform
3978     * @since 12
3979     */
3980    off(type: 'audioRendererChange'): void;
3981
3982    /**
3983     * Listens for audio capturer change events. When there is any audio capturer change,
3984     * registered clients will receive the callback.
3985     * @param { 'audioCapturerChange' } type - Type of the event to listen for. Only the audioCapturerChange event is supported.
3986     * @param { Callback<AudioCapturerChangeInfoArray> } callback - Callback invoked for the audio capturer change event.
3987     * @throws { BusinessError } 401 - Parameter error. Possible causes:
3988     *                                 1.Mandatory parameters are left unspecified;
3989     *                                 2.Incorrect parameter types.
3990     * @throws { BusinessError } 6800101 - Parameter verification failed.
3991     * @syscap SystemCapability.Multimedia.Audio.Capturer
3992     * @since 9
3993     */
3994    /**
3995     * Listens for audio capturer change events. When there is any audio capturer change,
3996     * registered clients will receive the callback.
3997     * @param { 'audioCapturerChange' } type - Type of the event to listen for. Only the audioCapturerChange event is supported.
3998     * @param { Callback<AudioCapturerChangeInfoArray> } callback - Callback invoked for the audio capturer change event.
3999     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4000     *                                 1.Mandatory parameters are left unspecified;
4001     *                                 2.Incorrect parameter types.
4002     * @throws { BusinessError } 6800101 - Parameter verification failed.
4003     * @syscap SystemCapability.Multimedia.Audio.Capturer
4004     * @crossplatform
4005     * @since 12
4006     */
4007    on(type: 'audioCapturerChange', callback: Callback<AudioCapturerChangeInfoArray>): void;
4008
4009    /**
4010     * UnSubscribes to audio capturer change events.
4011     * @param { 'audioCapturerChange' } type - Type of the event to listen for. Only the audioCapturerChange event is supported.
4012     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4013     *                                 1.Mandatory parameters are left unspecified;
4014     *                                 2.Incorrect parameter types.
4015     * @throws { BusinessError } 6800101 - Parameter verification failed.
4016     * @syscap SystemCapability.Multimedia.Audio.Capturer
4017     * @since 9
4018     */
4019    /**
4020     * UnSubscribes to audio capturer change events.
4021     * @param { 'audioCapturerChange' } type - Type of the event to listen for. Only the audioCapturerChange event is supported.
4022     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4023     *                                 1.Mandatory parameters are left unspecified;
4024     *                                 2.Incorrect parameter types.
4025     * @throws { BusinessError } 6800101 - Parameter verification failed.
4026     * @syscap SystemCapability.Multimedia.Audio.Capturer
4027     * @crossplatform
4028     * @since 12
4029     */
4030    off(type: 'audioCapturerChange'): void;
4031
4032    /**
4033     * Checks whether a stream is active. This method uses an asynchronous callback to return the query result.
4034     * @param { AudioVolumeType } volumeType - Audio stream type.
4035     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the stream.
4036     *  The value true means that the stream is active, and false means the opposite.
4037     * @syscap SystemCapability.Multimedia.Audio.Renderer
4038     * @since 9
4039     */
4040    /**
4041     * Checks whether a stream is active. This method uses an asynchronous callback to return the query result.
4042     * @param { AudioVolumeType } volumeType - Audio stream type.
4043     * @param { AsyncCallback<boolean> } callback - Callback used to return the active status of the stream.
4044     *  The value true means that the stream is active, and false means the opposite.
4045     * @syscap SystemCapability.Multimedia.Audio.Renderer
4046     * @crossplatform
4047     * @since 12
4048     */
4049    isActive(volumeType: AudioVolumeType, callback: AsyncCallback<boolean>): void;
4050    /**
4051     * Checks whether a stream is active. This method uses a promise to return the query result.
4052     * @param { AudioVolumeType } volumeType - Audio stream type.
4053     * @returns { Promise<boolean> } Promise used to return the active status of the stream. The value
4054     * true means that the stream is active, and false means the opposite.
4055     * @syscap SystemCapability.Multimedia.Audio.Renderer
4056     * @since 9
4057     */
4058    /**
4059     * Checks whether a stream is active. This method uses a promise to return the query result.
4060     * @param { AudioVolumeType } volumeType - Audio stream type.
4061     * @returns { Promise<boolean> } Promise used to return the active status of the stream. The value
4062     * true means that the stream is active, and false means the opposite.
4063     * @syscap SystemCapability.Multimedia.Audio.Renderer
4064     * @crossplatform
4065     * @since 12
4066     */
4067    isActive(volumeType: AudioVolumeType): Promise<boolean>;
4068    /**
4069     * Checks whether a stream is active.
4070     * @param { AudioVolumeType } volumeType - Audio stream type.
4071     * @returns { boolean } The active status of the stream.
4072     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4073     *                                 1.Mandatory parameters are left unspecified;
4074     *                                 2.Incorrect parameter types.
4075     * @throws { BusinessError } 6800101 - Parameter verification failed.
4076     * @syscap SystemCapability.Multimedia.Audio.Renderer
4077     * @since 10
4078     */
4079    /**
4080     * Checks whether a stream is active.
4081     * @param { AudioVolumeType } volumeType - Audio stream type.
4082     * @returns { boolean } The active status of the stream.
4083     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4084     *                                 1.Mandatory parameters are left unspecified;
4085     *                                 2.Incorrect parameter types.
4086     * @throws { BusinessError } 6800101 - Parameter verification failed.
4087     * @syscap SystemCapability.Multimedia.Audio.Renderer
4088     * @crossplatform
4089     * @since 12
4090     */
4091    isActiveSync(volumeType: AudioVolumeType): boolean;
4092  }
4093
4094  /**
4095   * Audio concurrency mode.
4096   * @enum { number }
4097   * @syscap SystemCapability.Multimedia.Audio.Core
4098   * @crossplatform
4099   * @since 12
4100   */
4101  enum AudioConcurrencyMode {
4102    /**
4103     * Default concurrency mode.
4104     * @syscap SystemCapability.Multimedia.Audio.Core
4105     * @crossplatform
4106     * @since 12
4107     */
4108    CONCURRENCY_DEFAULT = 0,
4109    /**
4110     * Mix with others mode.
4111     * @syscap SystemCapability.Multimedia.Audio.Core
4112     * @crossplatform
4113     * @since 12
4114     */
4115    CONCURRENCY_MIX_WITH_OTHERS = 1,
4116    /**
4117     * Duck others mode.
4118     * @syscap SystemCapability.Multimedia.Audio.Core
4119     * @crossplatform
4120     * @since 12
4121     */
4122    CONCURRENCY_DUCK_OTHERS = 2,
4123    /**
4124     * Pause others mode.
4125     * @syscap SystemCapability.Multimedia.Audio.Core
4126     * @crossplatform
4127     * @since 12
4128     */
4129    CONCURRENCY_PAUSE_OTHERS = 3,
4130  }
4131
4132  /**
4133   * Audio session deactivated reason.
4134   * @enum { number }
4135   * @syscap SystemCapability.Multimedia.Audio.Core
4136   * @crossplatform
4137   * @since 12
4138   */
4139  enum AudioSessionDeactivatedReason {
4140    /**
4141     * Lower priority.
4142     * @syscap SystemCapability.Multimedia.Audio.Core
4143     * @crossplatform
4144     * @since 12
4145     */
4146    DEACTIVATED_LOWER_PRIORITY = 0,
4147    /**
4148     * Time out.
4149     * @syscap SystemCapability.Multimedia.Audio.Core
4150     * @crossplatform
4151     * @since 12
4152     */
4153    DEACTIVATED_TIMEOUT = 1,
4154  }
4155
4156  /**
4157   * Audio session strategy.
4158   * @typedef AudioSessionStrategy
4159   * @syscap SystemCapability.Multimedia.Audio.Core
4160   * @crossplatform
4161   * @since 12
4162   */
4163  interface AudioSessionStrategy {
4164    /**
4165     * Audio concurrency mode.
4166     * @type { AudioConcurrencyMode }
4167     * @syscap SystemCapability.Multimedia.Audio.Core
4168     * @crossplatform
4169     * @since 12
4170     */
4171    concurrencyMode: AudioConcurrencyMode;
4172  }
4173
4174  /**
4175   * Audio session deactivated event.
4176   * @typedef AudioSessionDeactivatedEvent
4177   * @syscap SystemCapability.Multimedia.Audio.Core
4178   * @crossplatform
4179   * @since 12
4180   */
4181  interface AudioSessionDeactivatedEvent {
4182    /**
4183     * Audio session deactivated reason.
4184     * @type { AudioSessionDeactivatedReason }
4185     * @syscap SystemCapability.Multimedia.Audio.Core
4186     * @crossplatform
4187     * @since 12
4188     */
4189    reason: AudioSessionDeactivatedReason;
4190  }
4191
4192  /**
4193   * Implements audio session management.
4194   * @typedef AudioSessionManager
4195   * @syscap SystemCapability.Multimedia.Audio.Core
4196   * @crossplatform
4197   * @since 12
4198   */
4199  interface AudioSessionManager {
4200    /**
4201     * Activate the audio session for the current pid application.
4202     * @param { AudioSessionStrategy } strategy - Audio session strategy.
4203     * @returns { Promise<void> } Promise used to return the result.
4204     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4205     *                                 1.Mandatory parameters unspecified.
4206     *                                 2.Incorrect parameter types.
4207     * @throws { BusinessError } 6800101 - Parameter verification failed.
4208     * @throws { BusinessError } 6800301 - System error. Returned by promise.
4209     * @syscap SystemCapability.Multimedia.Audio.Core
4210     * @crossplatform
4211     * @since 12
4212     */
4213    activateAudioSession(strategy: AudioSessionStrategy): Promise<void>;
4214
4215    /**
4216     * Deactivate the audio session for the current pid application.
4217     * @returns { Promise<void> } Promise used to return the result.
4218     * @throws { BusinessError } 6800301 - System error. Returned by promise.
4219     * @syscap SystemCapability.Multimedia.Audio.Core
4220     * @crossplatform
4221     * @since 12
4222     */
4223    deactivateAudioSession(): Promise<void>;
4224
4225    /**
4226     * Check whether the audio session is activated for the current pid application.
4227     * @returns { boolean } The active audio session status for the current pid application.
4228     * @syscap SystemCapability.Multimedia.Audio.Core
4229     * @crossplatform
4230     * @since 12
4231     */
4232    isAudioSessionActivated(): boolean;
4233
4234    /**
4235     * Listens for audio session deactivated event. When the audio session is deactivated,
4236     * registered clients will receive the callback.
4237     * @param { 'audioSessionDeactivated' } type - Type of the event to listen for. Only the audioSessionDeactivated event is supported.
4238     * @param { Callback<AudioSessionDeactivatedEvent> } callback - Callback invoked for the audio session deactivated event.
4239     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4240     *                                 1.Mandatory parameters unspecified.
4241     *                                 2.Incorrect parameter types.
4242     * @throws { BusinessError } 6800101 - Parameter verification failed.
4243     * @syscap SystemCapability.Multimedia.Audio.Core
4244     * @crossplatform
4245     * @since 12
4246     */
4247    on(type: 'audioSessionDeactivated', callback: Callback<AudioSessionDeactivatedEvent>): void;
4248
4249    /**
4250    * Unsubscribes to audio session deactivated event.
4251    * @param { 'audioSessionDeactivated' } type - Type of the event to listen for. Only the audioSessionDeactivated event is supported.
4252    * @param { Callback<AudioSessionDeactivatedEvent> } callback - Callback invoked for the audio session deactivated event.
4253    * @throws { BusinessError } 401 - Parameter error. Possible causes:
4254    *                                 1.Mandatory parameters are left unspecified;
4255    *                                 2.Incorrect parameter types.
4256    * @throws { BusinessError } 6800101 - Parameter verification failed.
4257    * @syscap SystemCapability.Multimedia.Audio.Core
4258    * @crossplatform
4259    * @since 12
4260    */
4261    off(type: 'audioSessionDeactivated', callback?: Callback<AudioSessionDeactivatedEvent>): void;
4262  }
4263
4264  /**
4265   * Implements audio volume management.
4266   * @typedef AudioVolumeManager
4267   * @syscap SystemCapability.Multimedia.Audio.Volume
4268   * @since 9
4269   */
4270  /**
4271   * Implements audio volume management.
4272   * @typedef AudioVolumeManager
4273   * @syscap SystemCapability.Multimedia.Audio.Volume
4274   * @crossplatform
4275   * @since 12
4276   */
4277  interface AudioVolumeManager {
4278    /**
4279     * Get the volume group list for a networkId. This method uses an asynchronous callback to return the result.
4280     * @param { string } networkId - Distributed deice net work id
4281     * @param { AsyncCallback<VolumeGroupInfos> } callback - Callback used to return the result.
4282     * @syscap SystemCapability.Multimedia.Audio.Volume
4283     * @systemapi
4284     * @since 9
4285     */
4286    getVolumeGroupInfos(networkId: string, callback: AsyncCallback<VolumeGroupInfos>): void;
4287    /**
4288     * Get the volume group list for a networkId. This method uses a promise to return the result.
4289     * @param { string } networkId - Distributed deice net work id
4290     * @returns { Promise<VolumeGroupInfos> } Promise used to return the result.
4291     * @syscap SystemCapability.Multimedia.Audio.Volume
4292     * @systemapi
4293     * @since 9
4294     */
4295    getVolumeGroupInfos(networkId: string): Promise<VolumeGroupInfos>;
4296    /**
4297     * Get the volume group list for a networkId.
4298     * @param { string } networkId - Distributed deice net work id
4299     * @returns { VolumeGroupInfos } Volume group info list.
4300     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4301     *                                 1.Mandatory parameters are left unspecified;
4302     *                                 2.Incorrect parameter types.
4303     * @throws { BusinessError } 6800101 - Parameter verification failed.
4304     * @syscap SystemCapability.Multimedia.Audio.Volume
4305     * @systemapi
4306     * @since 10
4307     */
4308    getVolumeGroupInfosSync(networkId: string): VolumeGroupInfos;
4309
4310    /**
4311     * Obtains an AudioVolumeGroupManager instance. This method uses an asynchronous callback to return the result.
4312     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4313     * @param { AsyncCallback<AudioVolumeGroupManager> } callback - Callback used to return the result.
4314     * @syscap SystemCapability.Multimedia.Audio.Volume
4315     * @since 9
4316     */
4317    /**
4318     * Obtains an AudioVolumeGroupManager instance. This method uses an asynchronous callback to return the result.
4319     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4320     * @param { AsyncCallback<AudioVolumeGroupManager> } callback - Callback used to return the result.
4321     * @syscap SystemCapability.Multimedia.Audio.Volume
4322     * @crossplatform
4323     * @since 12
4324     */
4325    getVolumeGroupManager(groupId: number, callback: AsyncCallback<AudioVolumeGroupManager>): void;
4326    /**
4327     * Obtains an AudioVolumeGroupManager instance. This method uses a promise to return the result.
4328     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4329     * @returns { Promise<AudioVolumeGroupManager> } Promise used to return the result.
4330     * @syscap SystemCapability.Multimedia.Audio.Volume
4331     * @since 9
4332     */
4333    /**
4334     * Obtains an AudioVolumeGroupManager instance. This method uses a promise to return the result.
4335     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4336     * @returns { Promise<AudioVolumeGroupManager> } Promise used to return the result.
4337     * @syscap SystemCapability.Multimedia.Audio.Volume
4338     * @crossplatform
4339     * @since 12
4340     */
4341    getVolumeGroupManager(groupId: number): Promise<AudioVolumeGroupManager>;
4342    /**
4343     * Obtains an AudioVolumeGroupManager instance.
4344     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4345     * @returns { AudioVolumeGroupManager } The audio volume group manager instance.
4346     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4347     *                                 1.Mandatory parameters are left unspecified;
4348     *                                 2.Incorrect parameter types.
4349     * @throws { BusinessError } 6800101 - Parameter verification failed.
4350     * @syscap SystemCapability.Multimedia.Audio.Volume
4351     * @since 10
4352     */
4353    /**
4354     * Obtains an AudioVolumeGroupManager instance.
4355     * @param { number } groupId - volume group id, use LOCAL_VOLUME_GROUP_ID in default
4356     * @returns { AudioVolumeGroupManager } The audio volume group manager instance.
4357     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4358     *                                 1.Mandatory parameters are left unspecified;
4359     *                                 2.Incorrect parameter types.
4360     * @throws { BusinessError } 6800101 - Parameter verification failed.
4361     * @syscap SystemCapability.Multimedia.Audio.Volume
4362     * @crossplatform
4363     * @since 12
4364     */
4365    getVolumeGroupManagerSync(groupId: number): AudioVolumeGroupManager;
4366
4367    /**
4368     * Listens for system volume change events. This method uses a callback to get volume change events.
4369     * @param { 'volumeChange' } type - Type of the event to listen for. Only the volumeChange event is supported.
4370     * @param { Callback<VolumeEvent> } callback - Callback used to get the system volume change event.
4371     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4372     *                                 1.Mandatory parameters are left unspecified;
4373     *                                 2.Incorrect parameter types.
4374     * @throws { BusinessError } 6800101 - Parameter verification failed.
4375     * @syscap SystemCapability.Multimedia.Audio.Volume
4376     * @since 9
4377     */
4378    /**
4379     * Listens for system volume change events. This method uses a callback to get volume change events.
4380     * @param { 'volumeChange' } type - Type of the event to listen for. Only the volumeChange event is supported.
4381     * @param { Callback<VolumeEvent> } callback - Callback used to get the system volume change event.
4382     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4383     *                                 1.Mandatory parameters are left unspecified;
4384     *                                 2.Incorrect parameter types.
4385     * @throws { BusinessError } 6800101 - Parameter verification failed.
4386     * @syscap SystemCapability.Multimedia.Audio.Volume
4387     * @crossplatform
4388     * @since 12
4389     */
4390    on(type: 'volumeChange', callback: Callback<VolumeEvent>): void;
4391
4392    /**
4393     * Unsubscribes to the volume change events..
4394     * @param { 'volumeChange' } type - Type of the event to be unregistered. Only the volumeChange event is supported.
4395     * @param { Callback<VolumeEvent> } callback - Callback used to obtain the invoking volume change event.
4396     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4397     *                                 1.Mandatory parameters missing;
4398     *                                 2.Incorrect parameter types.
4399     * @throws { BusinessError } 6800101 - Parameter verification failed.
4400     * @syscap SystemCapability.Multimedia.Audio.Volume
4401     * @since 12
4402     */
4403    off(type: 'volumeChange', callback?: Callback<VolumeEvent>): void;
4404  }
4405
4406  /**
4407   * Implements audio volume group management.
4408   * @typedef AudioVolumeGroupManager
4409   * @syscap SystemCapability.Multimedia.Audio.Volume
4410   * @since 9
4411   */
4412  /**
4413   * Implements audio volume group management.
4414   * @typedef AudioVolumeGroupManager
4415   * @syscap SystemCapability.Multimedia.Audio.Volume
4416   * @crossplatform
4417   * @since 12
4418   */
4419  interface AudioVolumeGroupManager {
4420    /**
4421     * Sets the volume for a stream. This method uses an asynchronous callback to return the result.
4422     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4423     * @param { AudioVolumeType } volumeType - Audio stream type.
4424     * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume.
4425     * @param { AsyncCallback<void> } callback - Callback used to return the result.
4426     * @syscap SystemCapability.Multimedia.Audio.Volume
4427     * @systemapi
4428     * @since 9
4429     */
4430    setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback<void>): void;
4431    /**
4432     * Sets the volume for a stream. This method uses a promise to return the result.
4433     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4434     * @param { AudioVolumeType } volumeType - Audio stream type.
4435     * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume.
4436     * @returns { Promise<void> } Promise used to return the result.
4437     * @syscap SystemCapability.Multimedia.Audio.Volume
4438     * @systemapi
4439     * @since 9
4440     */
4441    setVolume(volumeType: AudioVolumeType, volume: number): Promise<void>;
4442
4443    /**
4444     * Sets the volume for a stream. This method uses a promise to return the result.
4445     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4446     * @param { AudioVolumeType } volumeType - Audio stream type.
4447     * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume.
4448     * @param { number } flags - volume flags used to enable different operations, can be union of {@link VolumeFlag}
4449     * @returns { Promise<void> } Promise used to return the result.
4450     * @throws { BusinessError } 201 - Permission denied.
4451     * @throws { BusinessError } 202 - Not system App.
4452     * @syscap SystemCapability.Multimedia.Audio.Volume
4453     * @systemapi
4454     * @since 12
4455     */
4456    setVolumeWithFlag(volumeType: AudioVolumeType, volume: number, flags: number): Promise<void>;
4457
4458    /**
4459     * Obtains the active volume type in the calling moment. This method returns in sync mode.
4460     * @param { number } uid - The target uid's active volume type or
4461     * 0 which means the global active volume type.
4462     * @returns { AudioVolumeType } Current active volume type.
4463     * @throws { BusinessError } 202 - Not system App.
4464     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4465     *                                 1.Mandatory parameters unspecified.
4466     *                                 2.Incorrect parameter types.
4467     * @throws { BusinessError } 6800101 - Parameter verification failed.
4468     * @syscap SystemCapability.Multimedia.Audio.Volume
4469     * @systemapi
4470     * @since 13
4471     */
4472    getActiveVolumeTypeSync(uid: number): AudioVolumeType;
4473
4474    /**
4475     * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result.
4476     * @param { AudioVolumeType } volumeType - Audio stream type.
4477     * @param { AsyncCallback<number> } callback - Callback used to return the volume.
4478     * @syscap SystemCapability.Multimedia.Audio.Volume
4479     * @since 9
4480     */
4481    /**
4482     * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result.
4483     * @param { AudioVolumeType } volumeType - Audio stream type.
4484     * @param { AsyncCallback<number> } callback - Callback used to return the volume.
4485     * @syscap SystemCapability.Multimedia.Audio.Volume
4486     * @crossplatform
4487     * @since 12
4488     */
4489    getVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
4490    /**
4491     * Obtains the volume of a stream. This method uses a promise to return the query result.
4492     * @param { AudioVolumeType } volumeType - Audio stream type.
4493     * @returns { Promise<number> } Promise used to return the volume.
4494     * @syscap SystemCapability.Multimedia.Audio.Volume
4495     * @since 9
4496     */
4497    /**
4498     * Obtains the volume of a stream. This method uses a promise to return the query result.
4499     * @param { AudioVolumeType } volumeType - Audio stream type.
4500     * @returns { Promise<number> } Promise used to return the volume.
4501     * @syscap SystemCapability.Multimedia.Audio.Volume
4502     * @crossplatform
4503     * @since 12
4504     */
4505    getVolume(volumeType: AudioVolumeType): Promise<number>;
4506    /**
4507     * Obtains the volume of a stream.
4508     * @param { AudioVolumeType } volumeType - Audio stream type.
4509     * @returns { number } Current system volume level.
4510     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4511     *                                 1.Mandatory parameters are left unspecified;
4512     *                                 2.Incorrect parameter types.
4513     * @throws { BusinessError } 6800101 - Parameter verification failed.
4514     * @syscap SystemCapability.Multimedia.Audio.Volume
4515     * @since 10
4516     */
4517    /**
4518     * Obtains the volume of a stream.
4519     * @param { AudioVolumeType } volumeType - Audio stream type.
4520     * @returns { number } Current system volume level.
4521     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4522     *                                 1.Mandatory parameters are left unspecified;
4523     *                                 2.Incorrect parameter types.
4524     * @throws { BusinessError } 6800101 - Parameter verification failed.
4525     * @syscap SystemCapability.Multimedia.Audio.Volume
4526     * @crossplatform
4527     * @since 12
4528     */
4529    getVolumeSync(volumeType: AudioVolumeType): number;
4530
4531    /**
4532     * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
4533     * @param { AudioVolumeType } volumeType - Audio stream type.
4534     * @param { AsyncCallback<number> } callback - Callback used to return the minimum volume.
4535     * @syscap SystemCapability.Multimedia.Audio.Volume
4536     * @since 9
4537     */
4538    /**
4539     * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
4540     * @param { AudioVolumeType } volumeType - Audio stream type.
4541     * @param { AsyncCallback<number> } callback - Callback used to return the minimum volume.
4542     * @syscap SystemCapability.Multimedia.Audio.Volume
4543     * @crossplatform
4544     * @since 12
4545     */
4546    getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
4547    /**
4548     * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result.
4549     * @param { AudioVolumeType } volumeType - Audio stream type.
4550     * @returns { Promise<number> } Promise used to return the minimum volume.
4551     * @syscap SystemCapability.Multimedia.Audio.Volume
4552     * @since 9
4553     */
4554    /**
4555     * Obtains the minimum volume allowed for a stream. This method uses a promise to return the query result.
4556     * @param { AudioVolumeType } volumeType - Audio stream type.
4557     * @returns { Promise<number> } Promise used to return the minimum volume.
4558     * @syscap SystemCapability.Multimedia.Audio.Volume
4559     * @crossplatform
4560     * @since 12
4561     */
4562    getMinVolume(volumeType: AudioVolumeType): Promise<number>;
4563    /**
4564     * Obtains the minimum volume allowed for a stream.
4565     * @param { AudioVolumeType } volumeType - Audio stream type.
4566     * @returns { number } Min volume level.
4567     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4568     *                                 1.Mandatory parameters are left unspecified;
4569     *                                 2.Incorrect parameter types.
4570     * @throws { BusinessError } 6800101 - Parameter verification failed.
4571     * @syscap SystemCapability.Multimedia.Audio.Volume
4572     * @since 10
4573     */
4574    /**
4575     * Obtains the minimum volume allowed for a stream.
4576     * @param { AudioVolumeType } volumeType - Audio stream type.
4577     * @returns { number } Min volume level.
4578     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4579     *                                 1.Mandatory parameters are left unspecified;
4580     *                                 2.Incorrect parameter types.
4581     * @throws { BusinessError } 6800101 - Parameter verification failed.
4582     * @syscap SystemCapability.Multimedia.Audio.Volume
4583     * @crossplatform
4584     * @since 12
4585     */
4586    getMinVolumeSync(volumeType: AudioVolumeType): number;
4587
4588    /**
4589     * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
4590     * @param { AudioVolumeType } volumeType - Audio stream type.
4591     * @param { AsyncCallback<number> } callback - Callback used to return the maximum volume.
4592     * @syscap SystemCapability.Multimedia.Audio.Volume
4593     * @since 9
4594     */
4595    /**
4596     * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result.
4597     * @param { AudioVolumeType } volumeType - Audio stream type.
4598     * @param { AsyncCallback<number> } callback - Callback used to return the maximum volume.
4599     * @syscap SystemCapability.Multimedia.Audio.Volume
4600     * @crossplatform
4601     * @since 12
4602     */
4603    getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback<number>): void;
4604    /**
4605     * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result.
4606     * @param { AudioVolumeType } volumeType - Audio stream type.
4607     * @returns { Promise<number> } Promise used to return the maximum volume.
4608     * @syscap SystemCapability.Multimedia.Audio.Volume
4609     * @since 9
4610     */
4611    /**
4612     * Obtains the maximum volume allowed for a stream. This method uses a promise to return the query result.
4613     * @param { AudioVolumeType } volumeType - Audio stream type.
4614     * @returns { Promise<number> } Promise used to return the maximum volume.
4615     * @syscap SystemCapability.Multimedia.Audio.Volume
4616     * @crossplatform
4617     * @since 12
4618     */
4619    getMaxVolume(volumeType: AudioVolumeType): Promise<number>;
4620    /**
4621     * Obtains the maximum volume allowed for a stream.
4622     * @param { AudioVolumeType } volumeType - Audio stream type.
4623     * @returns { number } Max volume level.
4624     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4625     *                                 1.Mandatory parameters are left unspecified;
4626     *                                 2.Incorrect parameter types.
4627     * @throws { BusinessError } 6800101 - Parameter verification failed.
4628     * @syscap SystemCapability.Multimedia.Audio.Volume
4629     * @since 10
4630     */
4631    /**
4632     * Obtains the maximum volume allowed for a stream.
4633     * @param { AudioVolumeType } volumeType - Audio stream type.
4634     * @returns { number } Max volume level.
4635     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4636     *                                 1.Mandatory parameters are left unspecified;
4637     *                                 2.Incorrect parameter types.
4638     * @throws { BusinessError } 6800101 - Parameter verification failed.
4639     * @syscap SystemCapability.Multimedia.Audio.Volume
4640     * @crossplatform
4641     * @since 12
4642     */
4643    getMaxVolumeSync(volumeType: AudioVolumeType): number;
4644
4645    /**
4646     * Mutes a stream. This method uses an asynchronous callback to return the result.
4647     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4648     * @param { AudioVolumeType } volumeType - Audio stream type.
4649     * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite.
4650     * @param { AsyncCallback<void> } callback - Callback used to return the result.
4651     * @syscap SystemCapability.Multimedia.Audio.Volume
4652     * @systemapi
4653     * @since 9
4654     */
4655    mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback<void>): void;
4656    /**
4657     * Mutes a stream. This method uses a promise to return the result.
4658     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4659     * @param { AudioVolumeType } volumeType - Audio stream type.
4660     * @param { boolean } mute - Mute status to set. The value true means to mute the stream, and false means the opposite.
4661     * @returns { Promise<void> } Promise used to return the result.
4662     * @syscap SystemCapability.Multimedia.Audio.Volume
4663     * @systemapi
4664     * @since 9
4665     */
4666    mute(volumeType: AudioVolumeType, mute: boolean): Promise<void>;
4667
4668    /**
4669     * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result.
4670     * @param { AudioVolumeType } volumeType - Audio stream type.
4671     * @param { AsyncCallback<boolean> } callback - Callback used to return the mute status of the stream. The
4672     * value true means that the stream is muted, and false means the opposite.
4673     * @syscap SystemCapability.Multimedia.Audio.Volume
4674     * @since 9
4675     */
4676    /**
4677     * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result.
4678     * @param { AudioVolumeType } volumeType - Audio stream type.
4679     * @param { AsyncCallback<boolean> } callback - Callback used to return the mute status of the stream. The
4680     * value true means that the stream is muted, and false means the opposite.
4681     * @syscap SystemCapability.Multimedia.Audio.Volume
4682     * @crossplatform
4683     * @since 12
4684     */
4685    isMute(volumeType: AudioVolumeType, callback: AsyncCallback<boolean>): void;
4686    /**
4687     * Checks whether a stream is muted. This method uses a promise to return the result.
4688     * @param { AudioVolumeType } volumeType - Audio stream type.
4689     * @returns { Promise<boolean> } Promise used to return the mute status of the stream. The value true
4690     * means that the stream is muted, and false means the opposite.
4691     * @syscap SystemCapability.Multimedia.Audio.Volume
4692     * @since 9
4693     */
4694    /**
4695     * Checks whether a stream is muted. This method uses a promise to return the result.
4696     * @param { AudioVolumeType } volumeType - Audio stream type.
4697     * @returns { Promise<boolean> } Promise used to return the mute status of the stream. The value true
4698     * means that the stream is muted, and false means the opposite.
4699     * @syscap SystemCapability.Multimedia.Audio.Volume
4700     * @crossplatform
4701     * @since 12
4702     */
4703    isMute(volumeType: AudioVolumeType): Promise<boolean>;
4704    /**
4705     * Checks whether a stream is muted.
4706     * @param { AudioVolumeType } volumeType - Audio stream type.
4707     * @returns { boolean } The mute status of the stream. The value true
4708     * means that the stream is muted, and false means the opposite.
4709     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4710     *                                 1.Mandatory parameters are left unspecified;
4711     *                                 2.Incorrect parameter types.
4712     * @throws { BusinessError } 6800101 - Parameter verification failed.
4713     * @syscap SystemCapability.Multimedia.Audio.Volume
4714     * @since 10
4715     */
4716    /**
4717     * Checks whether a stream is muted.
4718     * @param { AudioVolumeType } volumeType - Audio stream type.
4719     * @returns { boolean } The mute status of the stream. The value true
4720     * means that the stream is muted, and false means the opposite.
4721     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4722     *                                 1.Mandatory parameters are left unspecified;
4723     *                                 2.Incorrect parameter types.
4724     * @throws { BusinessError } 6800101 - Parameter verification failed.
4725     * @syscap SystemCapability.Multimedia.Audio.Volume
4726     * @crossplatform
4727     * @since 12
4728     */
4729    isMuteSync(volumeType: AudioVolumeType): boolean;
4730
4731    /**
4732     * Sets the ringer mode. This method uses an asynchronous callback to return the result.
4733     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4734     * @param { AudioRingMode } mode - Ringer mode.
4735     * @param { AsyncCallback<void> } callback - Callback used to return the result.
4736     * @syscap SystemCapability.Multimedia.Audio.Volume
4737     * @systemapi
4738     * @since 9
4739     */
4740    setRingerMode(mode: AudioRingMode, callback: AsyncCallback<void>): void;
4741    /**
4742     * Sets the ringer mode. This method uses a promise to return the result.
4743     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4744     * @param { AudioRingMode } mode - Ringer mode.
4745     * @returns { Promise<void> } Promise used to return the result.
4746     * @syscap SystemCapability.Multimedia.Audio.Volume
4747     * @systemapi
4748     * @since 9
4749     */
4750    setRingerMode(mode: AudioRingMode): Promise<void>;
4751
4752    /**
4753     * Obtains the ringer mode. This method uses an asynchronous callback to return the query result.
4754     * @param { AsyncCallback<AudioRingMode> } callback - Callback used to return the ringer mode.
4755     * @syscap SystemCapability.Multimedia.Audio.Volume
4756     * @since 9
4757     */
4758    /**
4759     * Obtains the ringer mode. This method uses an asynchronous callback to return the query result.
4760     * @param { AsyncCallback<AudioRingMode> } callback - Callback used to return the ringer mode.
4761     * @syscap SystemCapability.Multimedia.Audio.Volume
4762     * @crossplatform
4763     * @since 12
4764     */
4765    getRingerMode(callback: AsyncCallback<AudioRingMode>): void;
4766    /**
4767     * Obtains the ringer mode. This method uses a promise to return the query result.
4768     * @returns { Promise<AudioRingMode> } Promise used to return the ringer mode.
4769     * @syscap SystemCapability.Multimedia.Audio.Volume
4770     * @since 9
4771     */
4772    /**
4773     * Obtains the ringer mode. This method uses a promise to return the query result.
4774     * @returns { Promise<AudioRingMode> } Promise used to return the ringer mode.
4775     * @syscap SystemCapability.Multimedia.Audio.Volume
4776     * @crossplatform
4777     * @since 12
4778     */
4779    getRingerMode(): Promise<AudioRingMode>;
4780    /**
4781     * Obtains the ringer mode.
4782     * @returns { AudioRingMode } Current ringer mode.
4783     * @syscap SystemCapability.Multimedia.Audio.Volume
4784     * @since 10
4785     */
4786    /**
4787     * Obtains the ringer mode.
4788     * @returns { AudioRingMode } Current ringer mode.
4789     * @syscap SystemCapability.Multimedia.Audio.Volume
4790     * @crossplatform
4791     * @since 12
4792     */
4793    getRingerModeSync(): AudioRingMode;
4794
4795    /**
4796     * Listens for ringer mode change events. This method uses a callback to get ringer mode changes.
4797     * @param { 'ringerModeChange' } type - Type of the event to listen for. Only the ringerModeChange event is supported.
4798     * @param { Callback<AudioRingMode> } callback - Callback used to get the updated ringer mode.
4799     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4800     *                                 1.Mandatory parameters are left unspecified;
4801     *                                 2.Incorrect parameter types.
4802     * @throws { BusinessError } 6800101 - Parameter verification failed.
4803     * @syscap SystemCapability.Multimedia.Audio.Volume
4804     * @since 9
4805     */
4806    on(type: 'ringerModeChange', callback: Callback<AudioRingMode>): void;
4807
4808    /**
4809     * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result.
4810     * @permission ohos.permission.MANAGE_AUDIO_CONFIG
4811     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
4812     * @param { AsyncCallback<void> } callback - Callback used to return the result.
4813     * @syscap SystemCapability.Multimedia.Audio.Volume
4814     * @since 9
4815     * @deprecated since 11
4816     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicMute
4817     */
4818    setMicrophoneMute(mute: boolean, callback: AsyncCallback<void>): void;
4819    /**
4820     * Mutes or unmutes the microphone. This method uses a promise to return the result.
4821     * @permission ohos.permission.MANAGE_AUDIO_CONFIG
4822     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
4823     * @returns { Promise<void> } Promise used to return the result.
4824     * @syscap SystemCapability.Multimedia.Audio.Volume
4825     * @since 9
4826     * @deprecated since 11
4827     * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicMute
4828     */
4829    setMicrophoneMute(mute: boolean): Promise<void>;
4830
4831    /**
4832     * Mutes or unmutes the microphone. This method uses a promise to return the result.
4833     * @permission ohos.permission.MANAGE_AUDIO_CONFIG
4834     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
4835     * @returns { Promise<void> } Promise used to return the result.
4836     * @throws { BusinessError } 201 - Permission denied.
4837     * @throws { BusinessError } 202 - Not system App.
4838     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4839     *                                 1.Mandatory parameters are left unspecified;
4840     *                                 2.Incorrect parameter types.
4841     * @throws { BusinessError } 6800101 - Parameter verification failed.
4842     * @syscap SystemCapability.Multimedia.Audio.Volume
4843     * @systemapi
4844     * @since 11
4845     */
4846    setMicMute(mute: boolean): Promise<void>;
4847
4848    /**
4849     * Mutes or unmutes the microphone. This method uses a promise to return the result.
4850     * @permission ohos.permission.MICROPHONE_CONTROL
4851     * @param { boolean } mute - Mute status to set. The value true means to mute the microphone, and false means the opposite.
4852     * @param { PolicyType } type - Mute status to set. This value represents the caller's type such as EDM or privacy.
4853     * @returns { Promise<void> } Promise used to return the result.
4854     * @throws { BusinessError } 201 - Permission denied.
4855     * @throws { BusinessError } 202 - Not system App.
4856     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4857     *                                 1.Mandatory parameters missing.
4858     *                                 2.Incorrect parameter types.
4859     * @throws { BusinessError } 6800101 - Parameter verification failed.
4860     * @syscap SystemCapability.Multimedia.Audio.Volume
4861     * @systemapi
4862     * @since 12
4863     */
4864    setMicMutePersistent(mute: boolean, type: PolicyType): Promise<void>;
4865
4866    /**
4867     * Checks whether the persistent microphone status is muted.
4868     * @permission ohos.permission.MICROPHONE_CONTROL
4869     * @returns { boolean } Returns microphone persistent mute status.
4870     *     true: The persistent mic mute is enabled in the current system.
4871     *     false: The persistent mic mute is disabled in the current system.
4872     * @throws { BusinessError } 201 - Permission denied.
4873     * @throws { BusinessError } 202 - Not system App.
4874     * @syscap SystemCapability.Multimedia.Audio.Volume
4875     * @systemapi
4876     * @since 12
4877     */
4878    isPersistentMicMute(): boolean;
4879
4880    /**
4881     * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result.
4882     * @param { AsyncCallback<boolean> } callback - used to return the mute status of the microphone. The value
4883     * true means that the microphone is muted, and false means the opposite.
4884     * @syscap SystemCapability.Multimedia.Audio.Volume
4885     * @since 9
4886     */
4887    /**
4888     * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result.
4889     * @param { AsyncCallback<boolean> } callback - used to return the mute status of the microphone. The value
4890     * true means that the microphone is muted, and false means the opposite.
4891     * @syscap SystemCapability.Multimedia.Audio.Volume
4892     * @crossplatform
4893     * @since 12
4894     */
4895    isMicrophoneMute(callback: AsyncCallback<boolean>): void;
4896    /**
4897     * Checks whether the microphone is muted. This method uses a promise to return the query result.
4898     * @returns { Promise<boolean> } Promise used to return the mute status of the microphone. The value true
4899     * means that the microphone is muted, and false means the opposite.
4900     * @syscap SystemCapability.Multimedia.Audio.Volume
4901     * @since 9
4902     */
4903    /**
4904     * Checks whether the microphone is muted. This method uses a promise to return the query result.
4905     * @returns { Promise<boolean> } Promise used to return the mute status of the microphone. The value true
4906     * means that the microphone is muted, and false means the opposite.
4907     * @syscap SystemCapability.Multimedia.Audio.Volume
4908     * @crossplatform
4909     * @since 12
4910     */
4911    isMicrophoneMute(): Promise<boolean>;
4912    /**
4913     * Checks whether the microphone is muted.
4914     * @returns { boolean } The mute status of the microphone. The value true
4915     * means that the microphone is muted, and false means the opposite.
4916     * @syscap SystemCapability.Multimedia.Audio.Volume
4917     * @since 10
4918     */
4919    /**
4920     * Checks whether the microphone is muted.
4921     * @returns { boolean } The mute status of the microphone. The value true
4922     * means that the microphone is muted, and false means the opposite.
4923     * @syscap SystemCapability.Multimedia.Audio.Volume
4924     * @crossplatform
4925     * @since 12
4926     */
4927    isMicrophoneMuteSync(): boolean;
4928
4929    /**
4930     * Listens for system microphone state change events. This method uses a callback to get microphone change events.
4931     * @param { 'micStateChange' } type - Type of the event to listen for. Only the micStateChange event is supported.
4932     * @param { Callback<MicStateChangeEvent> } callback - Callback used to get the system microphone state change event.
4933     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4934     *                                 1.Mandatory parameters are left unspecified;
4935     *                                 2.Incorrect parameter types.
4936     * @throws { BusinessError } 6800101 - Parameter verification failed.
4937     * @syscap SystemCapability.Multimedia.Audio.Volume
4938     * @since 9
4939     */
4940    on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void;
4941
4942    /**
4943     * Unsubscribes to the microphone state change events.
4944     * @param { 'micStateChange' } type - Type of the event to listen for.
4945     * @param { Callback<MicStateChangeEvent> } callback - Callback used to get the system microphone state change event.
4946     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4947     *                                 1.Mandatory parameters missing;
4948     *                                 2.Incorrect parameter types.
4949     * @throws { BusinessError } 6800101 - Parameter verification failed.
4950     * @syscap SystemCapability.Multimedia.Audio.Volume
4951     * @since 12
4952     */
4953    off(type: 'micStateChange', callback?: Callback<MicStateChangeEvent>): void;
4954
4955    /**
4956     * Gets if this volume group is volume unadjustable.
4957     * @returns { boolean } Whether it is volume unadjustable.
4958     * @syscap SystemCapability.Multimedia.Audio.Volume
4959     * @since 10
4960     */
4961    /**
4962     * Gets if this volume group is volume unadjustable.
4963     * @returns { boolean } Whether it is volume unadjustable.
4964     * @syscap SystemCapability.Multimedia.Audio.Volume
4965     * @crossplatform
4966     * @since 12
4967     */
4968    isVolumeUnadjustable(): boolean;
4969
4970    /**
4971     * Adjusts system volume by step, volume type is decided by system.
4972     * This method uses an asynchronous callback to return the result.
4973     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4974     * @param { VolumeAdjustType } adjustType - Volume adjustment type.
4975     * @param { AsyncCallback<void> } callback - Callback used to return the result.
4976     * @throws { BusinessError } 201 - Permission denied.
4977     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4978     *                                 1.Mandatory parameters are left unspecified;
4979     *                                 2.Incorrect parameter types.
4980     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
4981     * @throws { BusinessError } 6800301 - System error. Return by callback.
4982     * @syscap SystemCapability.Multimedia.Audio.Volume
4983     * @systemapi
4984     * @since 10
4985     */
4986    adjustVolumeByStep(adjustType: VolumeAdjustType, callback: AsyncCallback<void>): void;
4987    /**
4988     * Adjusts system volume by step, volume type is decided by system.
4989     * This method uses a promise to return the result.
4990     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
4991     * @param { VolumeAdjustType } adjustType - Volume adjustment type.
4992     * @returns { Promise<void> } Promise used to return the result.
4993     * @throws { BusinessError } 201 - Permission denied.
4994     * @throws { BusinessError } 401 - Parameter error. Possible causes:
4995     *                                 1.Mandatory parameters are left unspecified;
4996     *                                 2.Incorrect parameter types.
4997     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
4998     * @throws { BusinessError } 6800301 - System error. Return by promise.
4999     * @syscap SystemCapability.Multimedia.Audio.Volume
5000     * @systemapi
5001     * @since 10
5002     */
5003    adjustVolumeByStep(adjustType: VolumeAdjustType): Promise<void>;
5004
5005    /**
5006     * Adjusts system volume by step for target volume type.
5007     * This method uses an asynchronous callback to return the result.
5008     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
5009     * @param { AudioVolumeType } volumeType - Audio volume type.
5010     * @param { VolumeAdjustType } adjustType - Volume adjustment type.
5011     * @param { AsyncCallback<void> } callback - Callback used to return the result.
5012     * @throws { BusinessError } 201 - Permission denied.
5013     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5014     *                                 1.Mandatory parameters are left unspecified;
5015     *                                 2.Incorrect parameter types.
5016     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
5017     * @throws { BusinessError } 6800301 - System error. Return by callback.
5018     * @syscap SystemCapability.Multimedia.Audio.Volume
5019     * @systemapi
5020     * @since 10
5021     */
5022    adjustSystemVolumeByStep(volumeType: AudioVolumeType, adjustType: VolumeAdjustType, callback: AsyncCallback<void>): void;
5023    /**
5024     * Adjusts system volume by step for target volume type.
5025     * This method uses a promise to return the result.
5026     * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY
5027     * @param { AudioVolumeType } volumeType - Audio volume type.
5028     * @param { VolumeAdjustType } adjustType - Volume adjustment type.
5029     * @returns { Promise<void> } Promise used to return the result.
5030     * @throws { BusinessError } 201 - Permission denied.
5031     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5032     *                                 1.Mandatory parameters are left unspecified;
5033     *                                 2.Incorrect parameter types.
5034     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
5035     * @throws { BusinessError } 6800301 - System error. Return by promise.
5036     * @syscap SystemCapability.Multimedia.Audio.Volume
5037     * @systemapi
5038     * @since 10
5039     */
5040    adjustSystemVolumeByStep(volumeType: AudioVolumeType, adjustType: VolumeAdjustType): Promise<void>;
5041
5042    /**
5043     * Gets the volume db value that system calculate by volume type, volume level and device type.
5044     * This method uses an asynchronous callback to return the result.
5045     * @param { AudioVolumeType } volumeType - Audio volume type.
5046     * @param { number } volumeLevel - Volume level to set.
5047     * @param { DeviceType } device - Output device type.
5048     * @param { AsyncCallback<number> } callback - Callback used to return the result.
5049     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5050     *                                 1.Mandatory parameters are left unspecified;
5051     *                                 2.Incorrect parameter types.
5052     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
5053     * @throws { BusinessError } 6800301 - System error. Return by callback.
5054     * @syscap SystemCapability.Multimedia.Audio.Volume
5055     * @since 10
5056     */
5057    /**
5058     * Gets the volume db value that system calculate by volume type, volume level and device type.
5059     * This method uses an asynchronous callback to return the result.
5060     * @param { AudioVolumeType } volumeType - Audio volume type.
5061     * @param { number } volumeLevel - Volume level to set.
5062     * @param { DeviceType } device - Output device type.
5063     * @param { AsyncCallback<number> } callback - Callback used to return the result.
5064     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5065     *                                 1.Mandatory parameters are left unspecified;
5066     *                                 2.Incorrect parameter types.
5067     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
5068     * @throws { BusinessError } 6800301 - System error. Return by callback.
5069     * @syscap SystemCapability.Multimedia.Audio.Volume
5070     * @crossplatform
5071     * @since 12
5072     */
5073    getSystemVolumeInDb(volumeType: AudioVolumeType, volumeLevel: number, device: DeviceType, callback: AsyncCallback<number>): void;
5074    /**
5075     * Gets the volume db value that system calculate by volume type, volume level and device type.
5076     * This method uses a promise to return the result.
5077     * @param { AudioVolumeType } volumeType - Audio volume type.
5078     * @param { number } volumeLevel - Volume level to set.
5079     * @param { DeviceType } device - Output device type.
5080     * @returns { Promise<number> } Promise used to return the result.
5081     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5082     *                                 1.Mandatory parameters are left unspecified;
5083     *                                 2.Incorrect parameter types.
5084     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
5085     * @throws { BusinessError } 6800301 - System error. Return by promise.
5086     * @syscap SystemCapability.Multimedia.Audio.Volume
5087     * @since 10
5088     */
5089    /**
5090     * Gets the volume db value that system calculate by volume type, volume level and device type.
5091     * This method uses a promise to return the result.
5092     * @param { AudioVolumeType } volumeType - Audio volume type.
5093     * @param { number } volumeLevel - Volume level to set.
5094     * @param { DeviceType } device - Output device type.
5095     * @returns { Promise<number> } Promise used to return the result.
5096     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5097     *                                 1.Mandatory parameters are left unspecified;
5098     *                                 2.Incorrect parameter types.
5099     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
5100     * @throws { BusinessError } 6800301 - System error. Return by promise.
5101     * @syscap SystemCapability.Multimedia.Audio.Volume
5102     * @crossplatform
5103     * @since 12
5104     */
5105    getSystemVolumeInDb(volumeType: AudioVolumeType, volumeLevel: number, device: DeviceType): Promise<number>;
5106    /**
5107     * Gets the volume db value that system calculate by volume type, volume level and device type.
5108     * @param { AudioVolumeType } volumeType - Audio volume type.
5109     * @param { number } volumeLevel - Volume level to set.
5110     * @param { DeviceType } device - Output device type.
5111     * @returns { number } The system volume in dB.
5112     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5113     *                                 1.Mandatory parameters are left unspecified;
5114     *                                 2.Incorrect parameter types.
5115     * @throws { BusinessError } 6800101 - Parameter verification failed.
5116     * @syscap SystemCapability.Multimedia.Audio.Volume
5117     * @since 10
5118     */
5119    /**
5120     * Gets the volume db value that system calculate by volume type, volume level and device type.
5121     * @param { AudioVolumeType } volumeType - Audio volume type.
5122     * @param { number } volumeLevel - Volume level to set.
5123     * @param { DeviceType } device - Output device type.
5124     * @returns { number } The system volume in dB.
5125     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5126     *                                 1.Mandatory parameters are left unspecified;
5127     *                                 2.Incorrect parameter types.
5128     * @throws { BusinessError } 6800101 - Parameter verification failed.
5129     * @syscap SystemCapability.Multimedia.Audio.Volume
5130     * @crossplatform
5131     * @since 12
5132     */
5133    getSystemVolumeInDbSync(volumeType: AudioVolumeType, volumeLevel: number, device: DeviceType): number;
5134
5135    /**
5136     * Gets the max amplitude value for a specific input device.
5137     * This method uses a promise to return the result.
5138     * @param { AudioDeviceDescriptor } inputDevice - the target device.
5139     * @returns { Promise<number> } Promise used to return the max amplitude value.
5140     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5141     *                                 1.Mandatory parameters are left unspecified;
5142     *                                 2.Incorrect parameter types.
5143     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
5144     * @throws { BusinessError } 6800301 - System error. Return by promise.
5145     * @syscap SystemCapability.Multimedia.Audio.Volume
5146     * @since 12
5147     */
5148    getMaxAmplitudeForInputDevice(inputDevice: AudioDeviceDescriptor): Promise<number>;
5149    /**
5150     * Gets the max amplitude value for a specific output device.
5151     * This method uses a promise to return the result.
5152     * @param { AudioDeviceDescriptor } outputDevice - the target device.
5153     * @returns { Promise<number> } Promise used to return the max amplitude value.
5154     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5155     *                                 1.Mandatory parameters are left unspecified;
5156     *                                 2.Incorrect parameter types.
5157     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
5158     * @throws { BusinessError } 6800301 - System error. Return by promise.
5159     * @syscap SystemCapability.Multimedia.Audio.Volume
5160     * @since 12
5161     */
5162    getMaxAmplitudeForOutputDevice(outputDevice: AudioDeviceDescriptor): Promise<number>;
5163  }
5164
5165  /**
5166   * This interface is used to notify the listener of any device Spatialization or Head Tracking enable state change.
5167   * @interface AudioSpatialEnabledStateForDevice
5168   * @syscap SystemCapability.Multimedia.Audio.Spatialization
5169   * @systemapi
5170   * @since 12
5171   */
5172  interface AudioSpatialEnabledStateForDevice {
5173    /**
5174     * Audio device description.
5175     * @type { AudioDeviceDescriptor }
5176     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5177     * @systemapi
5178     * @since 12
5179     */
5180    deviceDescriptor: AudioDeviceDescriptor;
5181    /**
5182     * Spatialization or Head Tracking enable state.
5183     * @type { boolean }
5184     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5185     * @systemapi
5186     * @since 12
5187     */
5188    enabled: boolean;
5189  }
5190
5191  /**
5192   * Implements audio spatialization management.
5193   * @typedef AudioSpatializationManager
5194   * @syscap SystemCapability.Multimedia.Audio.Spatialization
5195   * @systemapi
5196   * @since 11
5197   */
5198  interface AudioSpatializationManager {
5199    /**
5200     * Checks whether spatialization is supported by system.
5201     * @returns { boolean } Whether spatialization is supported by system.
5202     * @throws { BusinessError } 202 - Not system App.
5203     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5204     * @systemapi
5205     * @since 11
5206     */
5207    isSpatializationSupported(): boolean;
5208
5209    /**
5210     * Checks whether spatialization is supported by the specified device.
5211     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5212     * @returns { boolean } Whether spatialization is supported by the specified device.
5213     * @throws { BusinessError } 202 - Not system App.
5214     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5215     *                                 1.Mandatory parameters are left unspecified;
5216     *                                 2.Incorrect parameter types.
5217     * @throws { BusinessError } 6800101 - Parameter verification failed.
5218     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5219     * @systemapi
5220     * @since 11
5221     */
5222    isSpatializationSupportedForDevice(deviceDescriptor: AudioDeviceDescriptor): boolean;
5223
5224    /**
5225     * Checks whether head tracking is supported by system.
5226     * @returns { boolean } Whether head tracking is supported by system.
5227     * @throws { BusinessError } 202 - Not system App.
5228     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5229     * @systemapi
5230     * @since 11
5231     */
5232    isHeadTrackingSupported(): boolean;
5233
5234    /**
5235     * Checks whether head tracking is supported by the specified device.
5236     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5237     * @returns { boolean } Whether head tracking is supported by the specified device.
5238     * @throws { BusinessError } 202 - Not system App.
5239     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5240     *                                 1.Mandatory parameters are left unspecified;
5241     *                                 2.Incorrect parameter types.
5242     * @throws { BusinessError } 6800101 - Parameter verification failed.
5243     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5244     * @systemapi
5245     * @since 11
5246     */
5247    isHeadTrackingSupportedForDevice(deviceDescriptor: AudioDeviceDescriptor): boolean;
5248
5249    /**
5250     * Sets the spatialization enabled or disabled. This method uses an asynchronous callback to return the result.
5251     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5252     * @param { boolean } enable - Spatialization enable state.
5253     * @param { AsyncCallback<void> } callback - Callback used to return the result.
5254     * @throws { BusinessError } 201 - Permission denied. Return by callback.
5255     * @throws { BusinessError } 202 - Not system App.
5256     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5257     *                                 1.Mandatory parameters are left unspecified;
5258     *                                 2.Incorrect parameter types.
5259     * @throws { BusinessError } 6800101 - Parameter verification failed.
5260     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5261     * @systemapi
5262     * @since 11
5263     * @deprecated since 12
5264     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#setSpatializationEnabled
5265     */
5266    setSpatializationEnabled(enable: boolean, callback: AsyncCallback<void>): void;
5267    /**
5268     * Sets the spatialization enabled or disabled. This method uses a promise to return the result.
5269     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5270     * @param { boolean } enable - Spatialization enable state.
5271     * @returns { Promise<void> } Promise used to return the result.
5272     * @throws { BusinessError } 201 - Permission denied. Return by promise.
5273     * @throws { BusinessError } 202 - Not system App.
5274     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5275     *                                 1.Mandatory parameters are left unspecified;
5276     *                                 2.Incorrect parameter types.
5277     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5278     * @systemapi
5279     * @since 11
5280     * @deprecated since 12
5281     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#setSpatializationEnabled
5282     */
5283    setSpatializationEnabled(enable: boolean): Promise<void>;
5284    /**
5285     * Sets the spatialization enabled or disabled by the specified device.
5286     * This method uses a promise to return the result.
5287     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5288     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5289     * @param { boolean } enabled - Spatialization enable state.
5290     * @returns { Promise<void> } Promise used to return the result.
5291     * @throws { BusinessError } 201 - Permission denied. Return by promise.
5292     * @throws { BusinessError } 202 - Not system App.
5293     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5294     *                                 1.Mandatory parameters are left unspecified;
5295     *                                 2.Incorrect parameter types.
5296     * @throws { BusinessError } 6800101 - Parameter verification failed.
5297     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5298     * @systemapi
5299     * @since 12
5300     */
5301    setSpatializationEnabled(deviceDescriptor: AudioDeviceDescriptor, enabled: boolean): Promise<void>;
5302
5303    /**
5304     * Checks whether the spatialization is enabled.
5305     * @returns { boolean } Whether the spatialization is enabled.
5306     * @throws { BusinessError } 202 - Not system App.
5307     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5308     * @systemapi
5309     * @since 11
5310     * @deprecated since 12
5311     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#isSpatializationEnabled
5312     */
5313    isSpatializationEnabled(): boolean;
5314    /**
5315     * Checks whether the spatialization is enabled by the specified device.
5316     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5317     * @returns { boolean } Whether the spatialization is enabled by the specified device.
5318     * @throws { BusinessError } 202 - Not system App.
5319     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5320     *                                 1.Mandatory parameters are left unspecified;
5321     *                                 2.Incorrect parameter types.
5322     * @throws { BusinessError } 6800101 - Parameter verification failed.
5323     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5324     * @systemapi
5325     * @since 12
5326     */
5327    isSpatializationEnabled(deviceDescriptor: AudioDeviceDescriptor): boolean;
5328
5329    /**
5330     * Subscribes to the spatialization enable state change events. When the spatialization enable state changes,
5331     * registered clients will receive the callback.
5332     * @param { 'spatializationEnabledChange' } type - Type of the event to listen for.
5333     * @param { Callback<boolean> } callback - Callback used to get the spatialization enable state.
5334     * @throws { BusinessError } 202 - Not system App.
5335     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5336     *                                 1.Mandatory parameters are left unspecified;
5337     *                                 2.Incorrect parameter types.
5338     * @throws { BusinessError } 6800101 - Parameter verification failed.
5339     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5340     * @systemapi
5341     * @since 11
5342     * @deprecated since 12
5343     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#on
5344     */
5345    on(type: 'spatializationEnabledChange', callback: Callback<boolean>): void;
5346    /**
5347     * Subscribes to the spatialization enable state change events by the specified device.
5348     * When the spatialization enable state changes, registered clients will receive the callback.
5349     * @param { 'spatializationEnabledChangeForAnyDevice' } type - Type of the event to listen for.
5350     * @param { Callback<AudioSpatialEnabledStateForDevice> } callback - Callback used to get the spatialization enable state by the specified device.
5351     * @throws { BusinessError } 202 - Not system App.
5352     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5353     *                                 1.Mandatory parameters are left unspecified;
5354     *                                 2.Incorrect parameter types.
5355     * @throws { BusinessError } 6800101 - Parameter verification failed.
5356     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5357     * @systemapi
5358     * @since 12
5359     */
5360    on(type: 'spatializationEnabledChangeForAnyDevice', callback: Callback<AudioSpatialEnabledStateForDevice>): void;
5361
5362    /**
5363     * Unsubscribes to the spatialization enable state change events.
5364     * @param { 'spatializationEnabledChange' } type - Type of the event to listen for.
5365     * @param { Callback<boolean> } callback - Callback used to get the spatialization enable state.
5366     * @throws { BusinessError } 202 - Not system App.
5367     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5368     *                                 1.Mandatory parameters are left unspecified;
5369     *                                 2.Incorrect parameter types.
5370     * @throws { BusinessError } 6800101 - Parameter verification failed.
5371     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5372     * @systemapi
5373     * @since 11
5374     * @deprecated since 12
5375     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#off
5376     */
5377    off(type: 'spatializationEnabledChange', callback?: Callback<boolean>): void;
5378    /**
5379     * Unsubscribes to the spatialization enable state change events by the specified device.
5380     * @param { 'spatializationEnabledChangeForAnyDevice' } type - Type of the event to listen for.
5381     * @param { Callback<AudioSpatialEnabledStateForDevice> } callback - Callback used to get the spatialization enable state by the specified device.
5382     * @throws { BusinessError } 202 - Not system App.
5383     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5384     *                                 1.Mandatory parameters are left unspecified;
5385     *                                 2.Incorrect parameter types.
5386     * @throws { BusinessError } 6800101 - Parameter verification failed.
5387     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5388     * @systemapi
5389     * @since 12
5390     */
5391    off(type: 'spatializationEnabledChangeForAnyDevice', callback?: Callback<AudioSpatialEnabledStateForDevice>): void;
5392
5393    /**
5394     * Sets the head tracking enabled or disabled. This method uses an asynchronous callback to return the result.
5395     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5396     * @param { boolean } enable - Head tracking enable state.
5397     * @param { AsyncCallback<void> } callback - Callback used to return the result.
5398     * @throws { BusinessError } 201 - Permission denied. Return by callback.
5399     * @throws { BusinessError } 202 - Not system App.
5400     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5401     *                                 1.Mandatory parameters are left unspecified;
5402     *                                 2.Incorrect parameter types.
5403     * @throws { BusinessError } 6800101 - Parameter verification failed.
5404     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5405     * @systemapi
5406     * @since 11
5407     * @deprecated since 12
5408     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#setHeadTrackingEnabled
5409     */
5410    setHeadTrackingEnabled(enable: boolean, callback: AsyncCallback<void>): void;
5411    /**
5412     * Sets the head tracking enabled or disabled. This method uses a promise to return the result.
5413     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5414     * @param { boolean } enable - Head tracking enable state.
5415     * @returns { Promise<void> } Promise used to return the result.
5416     * @throws { BusinessError } 201 - Permission denied. Return by promise.
5417     * @throws { BusinessError } 202 - Not system App.
5418     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5419     *                                 1.Mandatory parameters are left unspecified;
5420     *                                 2.Incorrect parameter types.
5421     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5422     * @systemapi
5423     * @since 11
5424     * @deprecated since 12
5425     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#setHeadTrackingEnabled
5426     */
5427    setHeadTrackingEnabled(enable: boolean): Promise<void>;
5428    /**
5429     * Sets the head tracking enabled or disabled by the specified device.
5430     * This method uses a promise to return the result.
5431     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5432     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5433     * @param { boolean } enabled - Head tracking enable state.
5434     * @returns { Promise<void> } Promise used to return the result.
5435     * @throws { BusinessError } 201 - Permission denied. Return by promise.
5436     * @throws { BusinessError } 202 - Not system App.
5437     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5438     *                                 1.Mandatory parameters are left unspecified;
5439     *                                 2.Incorrect parameter types.
5440     * @throws { BusinessError } 6800101 - Parameter verification failed.
5441     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5442     * @systemapi
5443     * @since 12
5444     */
5445    setHeadTrackingEnabled(deviceDescriptor: AudioDeviceDescriptor, enabled: boolean): Promise<void>;
5446
5447    /**
5448     * Checks whether the head tracking is enabled.
5449     * @returns { boolean } Whether the head tracking is enabled.
5450     * @throws { BusinessError } 202 - Not system App.
5451     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5452     * @systemapi
5453     * @since 11
5454     * @deprecated since 12
5455     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#isHeadTrackingEnabled
5456     */
5457    isHeadTrackingEnabled(): boolean;
5458    /**
5459     * Checks whether the head tracking is enabled by the specified device.
5460     * @param { AudioDeviceDescriptor } deviceDescriptor - Audio device description.
5461     * @returns { boolean } Whether the head tracking is enabled by the specified device.
5462     * @throws { BusinessError } 202 - Not system App.
5463     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5464     *                                 1.Mandatory parameters are left unspecified;
5465     *                                 2.Incorrect parameter types.
5466     * @throws { BusinessError } 6800101 - Parameter verification failed.
5467     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5468     * @systemapi
5469     * @since 12
5470     */
5471    isHeadTrackingEnabled(deviceDescriptor: AudioDeviceDescriptor): boolean;
5472
5473    /**
5474     * Subscribes to the head tracking enable state change events. When the head tracking enable state changes,
5475     * registered clients will receive the callback.
5476     * @param { 'headTrackingEnabledChange' } type - Type of the event to listen for.
5477     * @param { Callback<boolean> } callback - Callback used to get the head tracking enable state.
5478     * @throws { BusinessError } 202 - Not system App.
5479     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5480     *                                 1.Mandatory parameters are left unspecified;
5481     *                                 2.Incorrect parameter types.
5482     * @throws { BusinessError } 6800101 - Parameter verification failed.
5483     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5484     * @systemapi
5485     * @since 11
5486     * @deprecated since 12
5487     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#on
5488     */
5489    on(type: 'headTrackingEnabledChange', callback: Callback<boolean>): void;
5490    /**
5491     * Subscribes to the head tracking enable state change events by the specified device.
5492     * When the head tracking enable state changes, registered clients will receive the callback.
5493     * @param { 'headTrackingEnabledChangeForAnyDevice' } type - Type of the event to listen for.
5494     * @param { Callback<AudioSpatialEnabledStateForDevice> } callback - Callback used to get the head tracking enable state by the specified device.
5495     * @throws { BusinessError } 202 - Not system App.
5496     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5497     *                                 1.Mandatory parameters are left unspecified;
5498     *                                 2.Incorrect parameter types.
5499     * @throws { BusinessError } 6800101 - Parameter verification failed.
5500     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5501     * @systemapi
5502     * @since 12
5503     */
5504    on(type: 'headTrackingEnabledChangeForAnyDevice', callback: Callback<AudioSpatialEnabledStateForDevice>): void;
5505
5506    /**
5507     * Unsubscribes to the head tracking enable state change events.
5508     * @param { 'headTrackingEnabledChange' } type - Type of the event to listen for.
5509     * @param { Callback<boolean> } callback - Callback used to get the head tracking enable state.
5510     * @throws { BusinessError } 202 - Not system App.
5511     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5512     *                                 1.Mandatory parameters are left unspecified;
5513     *                                 2.Incorrect parameter types.
5514     * @throws { BusinessError } 6800101 - Parameter verification failed.
5515     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5516     * @systemapi
5517     * @since 11
5518     * @deprecated since 12
5519     * @useinstead ohos.multimedia.audio.AudioSpatializationManager#off
5520     */
5521    off(type: 'headTrackingEnabledChange', callback?: Callback<boolean>): void;
5522    /**
5523     * Unsubscribes to the head tracking enable state change events by the specified device.
5524     * @param { 'headTrackingEnabledChangeForAnyDevice' } type - Type of the event to listen for.
5525     * @param { Callback<AudioSpatialEnabledStateForDevice> } callback - Callback used to get the head tracking enable state by the specified device.
5526     * @throws { BusinessError } 202 - Not system App.
5527     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5528     *                                 1.Mandatory parameters are left unspecified;
5529     *                                 2.Incorrect parameter types.
5530     * @throws { BusinessError } 6800101 - Parameter verification failed.
5531     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5532     * @systemapi
5533     * @since 12
5534     */
5535    off(type: 'headTrackingEnabledChangeForAnyDevice', callback?: Callback<AudioSpatialEnabledStateForDevice>): void;
5536
5537    /**
5538     * Updates the spatial device state.
5539     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5540     * @param { AudioSpatialDeviceState } spatialDeviceState - Spatial device state.
5541     * @throws { BusinessError } 201 - Permission denied.
5542     * @throws { BusinessError } 202 - Not system App.
5543     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5544     *                                 1.Mandatory parameters are left unspecified;
5545     *                                 2.Incorrect parameter types.
5546     * @throws { BusinessError } 6800101 - Parameter verification failed.
5547     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5548     * @systemapi
5549     * @since 11
5550     */
5551    updateSpatialDeviceState(spatialDeviceState: AudioSpatialDeviceState): void;
5552
5553    /**
5554     * Set spatialization rendering scene type.
5555     * @permission ohos.permission.MANAGE_SYSTEM_AUDIO_EFFECTS
5556     * @param { AudioSpatializationSceneType } spatializationSceneType - Spatialization scene type.
5557     * @throws { BusinessError } 201 - Permission denied.
5558     * @throws { BusinessError } 202 - Not system App.
5559     * @throws { BusinessError } 401 - Parameter error. Possible causes:
5560     *                                 1.Mandatory parameters are left unspecified;
5561     *                                 2.Incorrect parameter types.
5562     * @throws { BusinessError } 6800101 - Parameter verification failed.
5563     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5564     * @systemapi
5565     * @since 12
5566     */
5567    setSpatializationSceneType(spatializationSceneType: AudioSpatializationSceneType): void;
5568
5569    /**
5570     * Get spatialization rendering scene type.
5571     * @returns { AudioSpatializationSceneType } Current spatialization rendering scene type.
5572     * @throws { BusinessError } 202 - Not system App.
5573     * @syscap SystemCapability.Multimedia.Audio.Spatialization
5574     * @systemapi
5575     * @since 12
5576     */
5577    getSpatializationSceneType(): AudioSpatializationSceneType;
5578  }
5579
5580  /**
5581   * Connect type for device.
5582   * @enum { number }
5583   * @syscap SystemCapability.Multimedia.Audio.Volume
5584   * @systemapi
5585   * @since 9
5586   */
5587  enum ConnectType {
5588    /**
5589     * Connect type for local device.
5590     * @syscap SystemCapability.Multimedia.Audio.Volume
5591     * @systemapi
5592     * @since 9
5593     */
5594    CONNECT_TYPE_LOCAL = 1,
5595
5596    /**
5597     * Connect type for distributed device.
5598     * @syscap SystemCapability.Multimedia.Audio.Volume
5599     * @systemapi
5600     * @since 9
5601     */
5602    CONNECT_TYPE_DISTRIBUTED = 2
5603  }
5604
5605  /**
5606   * Describes an audio volume group.
5607   * @typedef VolumeGroupInfo
5608   * @syscap SystemCapability.Multimedia.Audio.Volume
5609   * @systemapi
5610   * @since 9
5611   */
5612  interface VolumeGroupInfo {
5613    /**
5614     * Device network id.
5615     * @type { string }
5616     * @syscap SystemCapability.Multimedia.Audio.Volume
5617     * @systemapi
5618     * @since 9
5619     */
5620    readonly networkId: string;
5621
5622    /**
5623     * Volume group id.
5624     * @type { number }
5625     * @syscap SystemCapability.Multimedia.Audio.Volume
5626     * @systemapi
5627     * @since 9
5628     */
5629    readonly groupId: number;
5630
5631    /**
5632     * Volume mapping group id.
5633     * @type { number }
5634     * @syscap SystemCapability.Multimedia.Audio.Volume
5635     * @systemapi
5636     * @since 9
5637     */
5638    readonly mappingId: number;
5639
5640    /**
5641     * Volume group name.
5642     * @type { string }
5643     * @syscap SystemCapability.Multimedia.Audio.Volume
5644     * @systemapi
5645     * @since 9
5646     */
5647    readonly groupName: string;
5648
5649    /**
5650     * Connect type of device for this group.
5651     * @type { ConnectType }
5652     * @syscap SystemCapability.Multimedia.Audio.Volume
5653     * @systemapi
5654     * @since 9
5655     */
5656    readonly type: ConnectType;
5657  }
5658
5659  /**
5660   * Array of VolumeGroupInfos, which is read-only.
5661   * @typedef { Array<Readonly<VolumeGroupInfo>> } VolumeGroupInfos
5662   * @syscap SystemCapability.Multimedia.Audio.Volume
5663   * @systemapi
5664   * @since 9
5665   */
5666  type VolumeGroupInfos = Array<Readonly<VolumeGroupInfo>>;
5667
5668  /**
5669   * Array of AudioRendererChangeInfo, which is read-only.
5670   * @typedef { Array<Readonly<AudioRendererChangeInfo>> } AudioRendererChangeInfoArray
5671   * @syscap SystemCapability.Multimedia.Audio.Renderer
5672   * @since 9
5673   */
5674  /**
5675   * Array of AudioRendererChangeInfo, which is read-only.
5676   * @typedef { Array<Readonly<AudioRendererChangeInfo>> } AudioRendererChangeInfoArray
5677   * @syscap SystemCapability.Multimedia.Audio.Renderer
5678   * @crossplatform
5679   * @since 12
5680   */
5681  type AudioRendererChangeInfoArray = Array<Readonly<AudioRendererChangeInfo>>;
5682
5683  /**
5684   * Describes audio renderer change information.
5685   * @typedef AudioRendererChangeInfo
5686   * @syscap SystemCapability.Multimedia.Audio.Renderer
5687   * @since 9
5688   */
5689  /**
5690   * Describes audio renderer change information.
5691   * @typedef AudioRendererChangeInfo
5692   * @syscap SystemCapability.Multimedia.Audio.Renderer
5693   * @crossplatform
5694   * @since 12
5695   */
5696  interface AudioRendererChangeInfo {
5697    /**
5698     * Audio stream unique id.
5699     * @type { number }
5700     * @syscap SystemCapability.Multimedia.Audio.Renderer
5701     * @since 9
5702     */
5703    /**
5704     * Audio stream unique id.
5705     * @type { number }
5706     * @syscap SystemCapability.Multimedia.Audio.Renderer
5707     * @crossplatform
5708     * @since 12
5709     */
5710    readonly streamId: number;
5711
5712    /**
5713     * Uid for audio renderer client application.
5714     * @type { number }
5715     * @syscap SystemCapability.Multimedia.Audio.Renderer
5716     * @systemapi
5717     * @since 9
5718     */
5719    readonly clientUid: number;
5720
5721    /**
5722     * Audio renderer information.
5723     * @type { AudioRendererInfo }
5724     * @syscap SystemCapability.Multimedia.Audio.Renderer
5725     * @since 9
5726     */
5727    /**
5728     * Audio renderer information.
5729     * @type { AudioRendererInfo }
5730     * @syscap SystemCapability.Multimedia.Audio.Renderer
5731     * @crossplatform
5732     * @since 12
5733     */
5734    readonly rendererInfo: AudioRendererInfo;
5735
5736    /**
5737     * Audio state.
5738     * @type { AudioState }
5739     * @syscap SystemCapability.Multimedia.Audio.Renderer
5740     * @systemapi
5741     * @since 9
5742     */
5743    readonly rendererState: AudioState;
5744
5745    /**
5746     * Audio output devices.
5747     * @type { AudioDeviceDescriptors }
5748     * @syscap SystemCapability.Multimedia.Audio.Renderer
5749     * @since 9
5750     */
5751    /**
5752     * Audio output devices.
5753     * @type { AudioDeviceDescriptors }
5754     * @syscap SystemCapability.Multimedia.Audio.Renderer
5755     * @crossplatform
5756     * @since 12
5757     */
5758    readonly deviceDescriptors: AudioDeviceDescriptors;
5759  }
5760
5761  /**
5762   * Array of AudioCapturerChangeInfo, which is read-only.
5763   * @typedef { Array<Readonly<AudioCapturerChangeInfo>> } AudioCapturerChangeInfoArray
5764   * @syscap SystemCapability.Multimedia.Audio.Capturer
5765   * @since 9
5766   */
5767  /**
5768   * Array of AudioCapturerChangeInfo, which is read-only.
5769   * @typedef { Array<Readonly<AudioCapturerChangeInfo>> } AudioCapturerChangeInfoArray
5770   * @syscap SystemCapability.Multimedia.Audio.Capturer
5771   * @crossplatform
5772   * @since 12
5773   */
5774  type AudioCapturerChangeInfoArray = Array<Readonly<AudioCapturerChangeInfo>>;
5775
5776  /**
5777   * Describes audio capturer change information.
5778   * @typedef AudioCapturerChangeInfo
5779   * @syscap SystemCapability.Multimedia.Audio.Capturer
5780   * @since 9
5781   */
5782  /**
5783   * Describes audio capturer change information.
5784   * @typedef AudioCapturerChangeInfo
5785   * @syscap SystemCapability.Multimedia.Audio.Capturer
5786   * @crossplatform
5787   * @since 12
5788   */
5789  interface AudioCapturerChangeInfo {
5790    /**
5791     * Audio stream unique id.
5792     * @type { number }
5793     * @syscap SystemCapability.Multimedia.Audio.Capturer
5794     * @since 9
5795     */
5796    /**
5797     * Audio stream unique id.
5798     * @type { number }
5799     * @syscap SystemCapability.Multimedia.Audio.Capturer
5800     * @crossplatform
5801     * @since 12
5802     */
5803    readonly streamId: number;
5804
5805    /**
5806     * Uid for audio capturer client application.
5807     * @type { number }
5808     * @syscap SystemCapability.Multimedia.Audio.Capturer
5809     * @systemapi
5810     * @since 9
5811     */
5812    readonly clientUid: number;
5813
5814    /**
5815     * Audio capturer information.
5816     * @type { AudioCapturerInfo }
5817     * @syscap SystemCapability.Multimedia.Audio.Capturer
5818     * @since 9
5819     */
5820    /**
5821     * Audio capturer information.
5822     * @type { AudioCapturerInfo }
5823     * @syscap SystemCapability.Multimedia.Audio.Capturer
5824     * @crossplatform
5825     * @since 12
5826     */
5827    readonly capturerInfo: AudioCapturerInfo;
5828
5829    /**
5830     * Audio state.
5831     * @type { AudioState }
5832     * @syscap SystemCapability.Multimedia.Audio.Capturer
5833     * @systemapi
5834     * @since 9
5835     */
5836    readonly capturerState: AudioState;
5837
5838    /**
5839     * Audio input devices.
5840     * @type { AudioDeviceDescriptors }
5841     * @syscap SystemCapability.Multimedia.Audio.Capturer
5842     * @since 9
5843     */
5844    /**
5845     * Audio input devices.
5846     * @type { AudioDeviceDescriptors }
5847     * @syscap SystemCapability.Multimedia.Audio.Capturer
5848     * @crossplatform
5849     * @since 12
5850     */
5851    readonly deviceDescriptors: AudioDeviceDescriptors;
5852
5853    /**
5854     * Audio capturer muted status.
5855     * @type { ?boolean }
5856     * @syscap SystemCapability.Multimedia.Audio.Capturer
5857     * @since 11
5858     */
5859    /**
5860     * Audio capturer muted status.
5861     * @type { ?boolean }
5862     * @syscap SystemCapability.Multimedia.Audio.Capturer
5863     * @crossplatform
5864     * @since 12
5865     */
5866    readonly muted?: boolean;
5867  }
5868
5869  /**
5870   * Describes an audio device.
5871   * @typedef AudioDeviceDescriptor
5872   * @syscap SystemCapability.Multimedia.Audio.Device
5873   * @since 7
5874   */
5875  /**
5876   * Describes an audio device.
5877   * @typedef AudioDeviceDescriptor
5878   * @syscap SystemCapability.Multimedia.Audio.Device
5879   * @crossplatform
5880   * @atomicservice
5881   * @since 12
5882   */
5883  interface AudioDeviceDescriptor {
5884    /**
5885     * Audio device role.
5886     * @type { DeviceRole }
5887     * @syscap SystemCapability.Multimedia.Audio.Device
5888     * @since 7
5889     */
5890    /**
5891     * Audio device role.
5892     * @type { DeviceRole }
5893     * @syscap SystemCapability.Multimedia.Audio.Device
5894     * @crossplatform
5895     * @atomicservice
5896     * @since 12
5897     */
5898    readonly deviceRole: DeviceRole;
5899
5900    /**
5901     * Audio device type.
5902     * @type { DeviceType }
5903     * @syscap SystemCapability.Multimedia.Audio.Device
5904     * @since 7
5905     */
5906    /**
5907     * Audio device type.
5908     * @type { DeviceType }
5909     * @syscap SystemCapability.Multimedia.Audio.Device
5910     * @crossplatform
5911     * @atomicservice
5912     * @since 12
5913     */
5914    readonly deviceType: DeviceType;
5915
5916    /**
5917     * Audio device id.
5918     * @type { number }
5919     * @syscap SystemCapability.Multimedia.Audio.Device
5920     * @since 9
5921     */
5922    /**
5923     * Audio device id.
5924     * @type { number }
5925     * @syscap SystemCapability.Multimedia.Audio.Device
5926     * @crossplatform
5927     * @atomicservice
5928     * @since 12
5929     */
5930    readonly id: number;
5931
5932    /**
5933     * Audio device name.
5934     * @type { string }
5935     * @syscap SystemCapability.Multimedia.Audio.Device
5936     * @since 9
5937     */
5938    /**
5939     * Audio device name.
5940     * @type { string }
5941     * @syscap SystemCapability.Multimedia.Audio.Device
5942     * @crossplatform
5943     * @atomicservice
5944     * @since 12
5945     */
5946    readonly name: string;
5947
5948    /**
5949     * Audio device address.
5950     * @type { string }
5951     * @syscap SystemCapability.Multimedia.Audio.Device
5952     * @since 9
5953     */
5954    /**
5955     * Audio device address.
5956     * @type { string }
5957     * @syscap SystemCapability.Multimedia.Audio.Device
5958     * @crossplatform
5959     * @atomicservice
5960     * @since 12
5961     */
5962    readonly address: string;
5963
5964    /**
5965     * Supported sampling rates.
5966     * @type { Array<number> }
5967     * @syscap SystemCapability.Multimedia.Audio.Device
5968     * @since 9
5969     */
5970    /**
5971     * Supported sampling rates.
5972     * @type { Array<number> }
5973     * @syscap SystemCapability.Multimedia.Audio.Device
5974     * @crossplatform
5975     * @atomicservice
5976     * @since 12
5977     */
5978    readonly sampleRates: Array<number>;
5979
5980    /**
5981     * Supported channel counts.
5982     * @type { Array<number> }
5983     * @syscap SystemCapability.Multimedia.Audio.Device
5984     * @since 9
5985     */
5986    /**
5987     * Supported channel counts.
5988     * @type { Array<number> }
5989     * @syscap SystemCapability.Multimedia.Audio.Device
5990     * @crossplatform
5991     * @atomicservice
5992     * @since 12
5993     */
5994    readonly channelCounts: Array<number>;
5995
5996    /**
5997     * Supported channel masks.
5998     * @type { Array<number> }
5999     * @syscap SystemCapability.Multimedia.Audio.Device
6000     * @since 9
6001     */
6002    /**
6003     * Supported channel masks.
6004     * @type { Array<number> }
6005     * @syscap SystemCapability.Multimedia.Audio.Device
6006     * @crossplatform
6007     * @atomicservice
6008     * @since 12
6009     */
6010    readonly channelMasks: Array<number>;
6011    /**
6012     * Device network id
6013     * @type { string }
6014     * @syscap SystemCapability.Multimedia.Audio.Device
6015     * @systemapi
6016     * @since 9
6017     */
6018    readonly networkId: string;
6019    /**
6020     * Interrupt group id
6021     * @type { number }
6022     * @syscap SystemCapability.Multimedia.Audio.Device
6023     * @systemapi
6024     * @since 9
6025     */
6026    readonly interruptGroupId: number;
6027    /**
6028     * Volume group id
6029     * @type { number }
6030     * @syscap SystemCapability.Multimedia.Audio.Device
6031     * @systemapi
6032     * @since 9
6033     */
6034    readonly volumeGroupId: number;
6035    /**
6036     * Name used to display, considering distributed device situation.
6037     * @type { string }
6038     * @syscap SystemCapability.Multimedia.Audio.Device
6039     * @since 10
6040     */
6041    /**
6042     * Name used to display, considering distributed device situation.
6043     * @type { string }
6044     * @syscap SystemCapability.Multimedia.Audio.Device
6045     * @crossplatform
6046     * @atomicservice
6047     * @since 12
6048     */
6049    readonly displayName: string;
6050
6051    /**
6052     * Supported encoding types.
6053     * @type { ?Array<AudioEncodingType> }
6054     * @syscap SystemCapability.Multimedia.Audio.Core
6055     * @since 11
6056     */
6057    /**
6058     * Supported encoding types.
6059     * @type { ?Array<AudioEncodingType> }
6060     * @syscap SystemCapability.Multimedia.Audio.Core
6061     * @crossplatform
6062     * @atomicservice
6063     * @since 12
6064     */
6065    readonly encodingTypes?: Array<AudioEncodingType>;
6066  }
6067
6068  /**
6069   * Array of AudioDeviceDescriptors, which is read-only.
6070   * @typedef { Array<Readonly<AudioDeviceDescriptor>> } AudioDeviceDescriptors
6071   * @syscap SystemCapability.Multimedia.Audio.Device
6072   * @since 7
6073   */
6074  /**
6075   * Array of AudioDeviceDescriptors, which is read-only.
6076   * @typedef { Array<Readonly<AudioDeviceDescriptor>> } AudioDeviceDescriptors
6077   * @syscap SystemCapability.Multimedia.Audio.Device
6078   * @crossplatform
6079   * @atomicservice
6080   * @since 12
6081   */
6082  type AudioDeviceDescriptors = Array<Readonly<AudioDeviceDescriptor>>;
6083
6084  /**
6085   * Describes the volume event received by the app when the volume is changed.
6086   * @typedef VolumeEvent
6087   * @syscap SystemCapability.Multimedia.Audio.Volume
6088   * @since 9
6089   */
6090  /**
6091   * Describes the volume event received by the app when the volume is changed.
6092   * @typedef VolumeEvent
6093   * @syscap SystemCapability.Multimedia.Audio.Volume
6094   * @crossplatform
6095   * @since 12
6096   */
6097  interface VolumeEvent {
6098    /**
6099     * Volume type of the current stream.
6100     * @type { AudioVolumeType }
6101     * @syscap SystemCapability.Multimedia.Audio.Volume
6102     * @since 9
6103     */
6104    volumeType: AudioVolumeType;
6105    /**
6106     * Volume level.
6107     * @type { number }
6108     * @syscap SystemCapability.Multimedia.Audio.Volume
6109     * @since 9
6110     */
6111    /**
6112     * Volume level.
6113     * @type { number }
6114     * @syscap SystemCapability.Multimedia.Audio.Volume
6115     * @crossplatform
6116     * @since 12
6117     */
6118    volume: number;
6119    /**
6120     * Whether to show the volume change in UI.
6121     * @type { boolean }
6122     * @syscap SystemCapability.Multimedia.Audio.Volume
6123     * @since 9
6124     */
6125    updateUi: boolean;
6126    /**
6127     * volumeGroup id
6128     * @type { number }
6129     * @syscap SystemCapability.Multimedia.Audio.Volume
6130     * @systemapi
6131     * @since 9
6132     */
6133    volumeGroupId: number;
6134    /**
6135     * Device network id
6136     * @type { string }
6137     * @syscap SystemCapability.Multimedia.Audio.Volume
6138     * @systemapi
6139     * @since 9
6140     */
6141    networkId: string;
6142  }
6143
6144  /**
6145   * Describes the callback invoked for audio interruption or focus gain events.When the audio of an application
6146   * is interrupted by another application, the callback is invoked to notify the former application.
6147   * @typedef InterruptAction
6148   * @syscap SystemCapability.Multimedia.Audio.Renderer
6149   * @since 7
6150   * @deprecated since 9
6151   * @useinstead ohos.multimedia.audio.InterruptEvent
6152   */
6153  interface InterruptAction {
6154
6155    /**
6156     * Event type.
6157     * The value TYPE_ACTIVATED means the focus gain event, and TYPE_INTERRUPT means the audio interruption event.
6158     * @type { InterruptActionType }
6159     * @syscap SystemCapability.Multimedia.Audio.Renderer
6160     * @since 7
6161     * @deprecated since 9
6162     */
6163    actionType: InterruptActionType;
6164
6165    /**
6166     * Type of the audio interruption event.
6167     * @type { ?InterruptType }
6168     * @syscap SystemCapability.Multimedia.Audio.Renderer
6169     * @since 7
6170     * @deprecated since 9
6171     */
6172    type?: InterruptType;
6173
6174    /**
6175     * Hint for the audio interruption event.
6176     * @type { ?InterruptHint }
6177     * @syscap SystemCapability.Multimedia.Audio.Renderer
6178     * @since 7
6179     * @deprecated since 9
6180     */
6181    hint?: InterruptHint;
6182
6183    /**
6184     * Whether the focus is gained or released. The value true means that the focus is gained or released,
6185     * and false means that the focus fails to be gained or released.
6186     * @type { ?boolean }
6187     * @syscap SystemCapability.Multimedia.Audio.Renderer
6188     * @since 7
6189     * @deprecated since 9
6190     */
6191    activated?: boolean;
6192  }
6193
6194  /**
6195   * Describes input parameters of audio listening events.
6196   * @typedef AudioInterrupt
6197   * @syscap SystemCapability.Multimedia.Audio.Renderer
6198   * @since 7
6199   * @deprecated since 9
6200   */
6201  interface AudioInterrupt {
6202
6203    /**
6204     * Audio stream usage type.
6205     * @type { StreamUsage }
6206     * @syscap SystemCapability.Multimedia.Audio.Renderer
6207     * @since 7
6208     * @deprecated since 9
6209     */
6210    streamUsage: StreamUsage;
6211
6212    /**
6213     * Type of the media interrupted.
6214     * @type { ContentType }
6215     * @syscap SystemCapability.Multimedia.Audio.Renderer
6216     * @since 7
6217     * @deprecated since 9
6218     */
6219    contentType: ContentType;
6220
6221    /**
6222     * Whether audio playback can be paused when it is interrupted.
6223     * The value true means that audio playback can be paused when it is interrupted, and false means the opposite.
6224     * @type { boolean }
6225     * @syscap SystemCapability.Multimedia.Audio.Renderer
6226     * @since 7
6227     * @deprecated since 9
6228     */
6229    pauseWhenDucked: boolean;
6230  }
6231
6232  /**
6233   * Describes the microphone state change event received by the app when the microphone state is changed.
6234   * @typedef MicStateChangeEvent
6235   * @syscap SystemCapability.Multimedia.Audio.Device
6236   * @since 9
6237   */
6238  interface MicStateChangeEvent {
6239    /**
6240     * Mic mute state.
6241     * @type { boolean }
6242     * @syscap SystemCapability.Multimedia.Audio.Device
6243     * @since 9
6244     */
6245    mute: boolean;
6246  }
6247  /**
6248   * Describes the device change type and device information.
6249   * @typedef DeviceChangeAction
6250   * @syscap SystemCapability.Multimedia.Audio.Device
6251   * @since 7
6252   */
6253  /**
6254   * Describes the device change type and device information.
6255   * @typedef DeviceChangeAction
6256   * @syscap SystemCapability.Multimedia.Audio.Device
6257   * @crossplatform
6258   * @since 12
6259   */
6260  interface DeviceChangeAction {
6261    /**
6262     * Device change type.
6263     * @type { DeviceChangeType }
6264     * @syscap SystemCapability.Multimedia.Audio.Device
6265     * @since 7
6266     */
6267    /**
6268     * Device change type.
6269     * @type { DeviceChangeType }
6270     * @syscap SystemCapability.Multimedia.Audio.Device
6271     * @crossplatform
6272     * @since 12
6273     */
6274    type: DeviceChangeType;
6275
6276    /**
6277     * Device information.
6278     * @type { AudioDeviceDescriptors }
6279     * @syscap SystemCapability.Multimedia.Audio.Device
6280     * @since 7
6281     */
6282    /**
6283     * Device information.
6284     * @type { AudioDeviceDescriptors }
6285     * @syscap SystemCapability.Multimedia.Audio.Device
6286     * @crossplatform
6287     * @since 12
6288     */
6289    deviceDescriptors: AudioDeviceDescriptors;
6290  }
6291
6292  /**
6293   * Enumerates channel blend mode.
6294   * @enum { number }
6295   * @syscap SystemCapability.Multimedia.Audio.Core
6296   * @since 11
6297   */
6298  /**
6299   * Enumerates channel blend mode.
6300   * @enum { number }
6301   * @syscap SystemCapability.Multimedia.Audio.Core
6302   * @crossplatform
6303   * @since 12
6304   */
6305  enum ChannelBlendMode {
6306    /**
6307     * No channel process.
6308     * @syscap SystemCapability.Multimedia.Audio.Core
6309     * @since 11
6310     */
6311    /**
6312     * No channel process.
6313     * @syscap SystemCapability.Multimedia.Audio.Core
6314     * @crossplatform
6315     * @since 12
6316     */
6317    MODE_DEFAULT = 0,
6318    /**
6319     * Blend left and right channel.
6320     * @syscap SystemCapability.Multimedia.Audio.Core
6321     * @since 11
6322     */
6323    /**
6324     * Blend left and right channel.
6325     * @syscap SystemCapability.Multimedia.Audio.Core
6326     * @crossplatform
6327     * @since 12
6328     */
6329    MODE_BLEND_LR = 1,
6330    /**
6331     * Replicate left to right channel.
6332     * @syscap SystemCapability.Multimedia.Audio.Core
6333     * @since 11
6334     */
6335    /**
6336     * Replicate left to right channel.
6337     * @syscap SystemCapability.Multimedia.Audio.Core
6338     * @crossplatform
6339     * @since 12
6340     */
6341    MODE_ALL_LEFT = 2,
6342    /**
6343     * Replicate right to left channel.
6344     * @syscap SystemCapability.Multimedia.Audio.Core
6345     * @since 11
6346     */
6347    /**
6348     * Replicate right to left channel.
6349     * @syscap SystemCapability.Multimedia.Audio.Core
6350     * @crossplatform
6351     * @since 12
6352     */
6353    MODE_ALL_RIGHT = 3,
6354  }
6355
6356  /**
6357   * Enumerates audio stream device change reason.
6358   * @enum { number }
6359   * @syscap SystemCapability.Multimedia.Audio.Device
6360   * @since 11
6361   */
6362  /**
6363   * Enumerates audio stream device change reason.
6364   * @enum { number }
6365   * @syscap SystemCapability.Multimedia.Audio.Device
6366   * @crossplatform
6367   * @atomicservice
6368   * @since 12
6369   */
6370  enum AudioStreamDeviceChangeReason {
6371    /**
6372     * Unknown.
6373     * @syscap SystemCapability.Multimedia.Audio.Device
6374     * @since 11
6375     */
6376    /**
6377     * Unknown.
6378     * @syscap SystemCapability.Multimedia.Audio.Device
6379     * @crossplatform
6380     * @atomicservice
6381     * @since 12
6382     */
6383    REASON_UNKNOWN = 0,
6384    /**
6385     * New device available.
6386     * @syscap SystemCapability.Multimedia.Audio.Device
6387     * @since 11
6388     */
6389    /**
6390     * New device available.
6391     * @syscap SystemCapability.Multimedia.Audio.Device
6392     * @crossplatform
6393     * @atomicservice
6394     * @since 12
6395     */
6396    REASON_NEW_DEVICE_AVAILABLE = 1,
6397    /**
6398     * Old device unavailable. Applications should consider to pause the audio playback when this reason is
6399     * reported.
6400     * @syscap SystemCapability.Multimedia.Audio.Device
6401     * @since 11
6402     */
6403    /**
6404     * Old device unavailable. Applications should consider to pause the audio playback when this reason is
6405     * reported.
6406     * @syscap SystemCapability.Multimedia.Audio.Device
6407     * @crossplatform
6408     * @atomicservice
6409     * @since 12
6410     */
6411    REASON_OLD_DEVICE_UNAVAILABLE = 2,
6412    /**
6413     * Overrode by user or system.
6414     * @syscap SystemCapability.Multimedia.Audio.Device
6415     * @since 11
6416     */
6417    /**
6418     * Overrode by user or system.
6419     * @syscap SystemCapability.Multimedia.Audio.Device
6420     * @crossplatform
6421     * @atomicservice
6422     * @since 12
6423     */
6424    REASON_OVERRODE = 3,
6425  }
6426  /**
6427   * Audio stream device change info.
6428   * @typedef AudioStreamDeviceChangeInfo
6429   * @syscap SystemCapability.Multimedia.Audio.Device
6430   * @since 11
6431   */
6432  /**
6433   * Audio stream device change info.
6434   * @typedef AudioStreamDeviceChangeInfo
6435   * @syscap SystemCapability.Multimedia.Audio.Device
6436   * @crossplatform
6437   * @atomicservice
6438   * @since 12
6439   */
6440  interface AudioStreamDeviceChangeInfo {
6441    /**
6442     * Audio device descriptors after change.
6443     * @type { AudioDeviceDescriptors }
6444     * @syscap SystemCapability.Multimedia.Audio.Device
6445     * @since 11
6446     */
6447    /**
6448     * Audio device descriptors after change.
6449     * @type { AudioDeviceDescriptors }
6450     * @syscap SystemCapability.Multimedia.Audio.Device
6451     * @crossplatform
6452     * @atomicservice
6453     * @since 12
6454     */
6455    devices: AudioDeviceDescriptors;
6456    /**
6457     * Audio stream device change reason.
6458     * @type { AudioStreamDeviceChangeReason }
6459     * @syscap SystemCapability.Multimedia.Audio.Device
6460     * @since 11
6461     */
6462    /**
6463     * Audio stream device change reason.
6464     * @type { AudioStreamDeviceChangeReason }
6465     * @syscap SystemCapability.Multimedia.Audio.Device
6466     * @crossplatform
6467     * @atomicservice
6468     * @since 12
6469     */
6470    changeReason: AudioStreamDeviceChangeReason;
6471  }
6472
6473  /**
6474   * Enumerates callback result.
6475   * @enum { number }
6476   * @syscap SystemCapability.Multimedia.Audio.Core
6477   * @crossplatform
6478   * @since 12
6479   */
6480  enum AudioDataCallbackResult {
6481    /**
6482     * Indicates data of this callback is invalid.
6483     * @syscap SystemCapability.Multimedia.Audio.Core
6484     * @crossplatform
6485     * @since 12
6486     */
6487    INVALID = -1,
6488
6489    /**
6490     * Indicates data of this callback is valid.
6491     * @syscap SystemCapability.Multimedia.Audio.Core
6492     * @crossplatform
6493     * @since 12
6494     */
6495    VALID = 0,
6496  }
6497
6498  /**
6499   * Type definition of callback function for audio renderer write data.
6500   *
6501   * @typedef { function } AudioRendererWriteDataCallback
6502   * @param { ArrayBuffer } data - audio data array buffer.
6503   * @returns { AudioDataCallbackResult | void } result of callback or void. If void or AudioDataCallbackResult.VALID is
6504   * returned, it indicates the data is valid and will be played. If AudioDataCallbackResult.INVALID is returned, it
6505   * indicates the data is will not be played.
6506   * @syscap SystemCapability.Multimedia.Audio.Renderer
6507   * @crossplatform
6508   * @since 12
6509   */
6510  type AudioRendererWriteDataCallback = (data: ArrayBuffer) => AudioDataCallbackResult | void;
6511
6512  /**
6513   * Provides audio playback APIs.
6514   * @typedef AudioRenderer
6515   * @syscap SystemCapability.Multimedia.Audio.Renderer
6516   * @since 8
6517   */
6518  /**
6519   * Provides audio playback APIs.
6520   * @typedef AudioRenderer
6521   * @syscap SystemCapability.Multimedia.Audio.Renderer
6522   * @crossplatform
6523   * @since 12
6524   */
6525  interface AudioRenderer {
6526    /**
6527     * Defines the current render state.
6528     * @type { AudioState }
6529     * @syscap SystemCapability.Multimedia.Audio.Renderer
6530     * @since 8
6531     */
6532    /**
6533     * Defines the current render state.
6534     * @type { AudioState }
6535     * @syscap SystemCapability.Multimedia.Audio.Renderer
6536     * @crossplatform
6537     * @since 12
6538     */
6539    readonly state: AudioState;
6540
6541    /**
6542     * Obtains the renderer information provided while creating a renderer instance. This method uses an asynchronous
6543     * callback to return the result.
6544     * @param { AsyncCallback<AudioRendererInfo> } callback - Callback used to return the renderer information.
6545     * @syscap SystemCapability.Multimedia.Audio.Renderer
6546     * @since 8
6547     */
6548    /**
6549     * Obtains the renderer information provided while creating a renderer instance. This method uses an asynchronous
6550     * callback to return the result.
6551     * @param { AsyncCallback<AudioRendererInfo> } callback - Callback used to return the renderer information.
6552     * @syscap SystemCapability.Multimedia.Audio.Renderer
6553     * @crossplatform
6554     * @since 12
6555     */
6556    getRendererInfo(callback: AsyncCallback<AudioRendererInfo>): void;
6557    /**
6558     * Obtains the renderer information provided while creating a renderer instance. This method uses a promise to
6559     * return the result.
6560     * @returns { Promise<AudioRendererInfo> } Promise used to return the renderer information.
6561     * @syscap SystemCapability.Multimedia.Audio.Renderer
6562     * @since 8
6563     */
6564    /**
6565     * Obtains the renderer information provided while creating a renderer instance. This method uses a promise to
6566     * return the result.
6567     * @returns { Promise<AudioRendererInfo> } Promise used to return the renderer information.
6568     * @syscap SystemCapability.Multimedia.Audio.Renderer
6569     * @crossplatform
6570     * @since 12
6571     */
6572    getRendererInfo(): Promise<AudioRendererInfo>;
6573    /**
6574     * Obtains the renderer information provided while creating a renderer instance.
6575     * @returns { AudioRendererInfo } The renderer information.
6576     * @syscap SystemCapability.Multimedia.Audio.Renderer
6577     * @since 10
6578     */
6579    /**
6580     * Obtains the renderer information provided while creating a renderer instance.
6581     * @returns { AudioRendererInfo } The renderer information.
6582     * @syscap SystemCapability.Multimedia.Audio.Renderer
6583     * @crossplatform
6584     * @since 12
6585     */
6586    getRendererInfoSync(): AudioRendererInfo;
6587
6588    /**
6589     * Obtains the renderer stream information. This method uses an asynchronous callback to return the result.
6590     * @param { AsyncCallback<AudioStreamInfo> } callback - Callback used to return the stream information.
6591     * @syscap SystemCapability.Multimedia.Audio.Renderer
6592     * @since 8
6593     */
6594    /**
6595     * Obtains the renderer stream information. This method uses an asynchronous callback to return the result.
6596     * @param { AsyncCallback<AudioStreamInfo> } callback - Callback used to return the stream information.
6597     * @syscap SystemCapability.Multimedia.Audio.Renderer
6598     * @crossplatform
6599     * @since 12
6600     */
6601    getStreamInfo(callback: AsyncCallback<AudioStreamInfo>): void;
6602    /**
6603     * Obtains the renderer stream information. This method uses a promise to return the result.
6604     * @returns { Promise<AudioStreamInfo> } Promise used to return the stream information.
6605     * @syscap SystemCapability.Multimedia.Audio.Renderer
6606     * @since 8
6607     */
6608    /**
6609     * Obtains the renderer stream information. This method uses a promise to return the result.
6610     * @returns { Promise<AudioStreamInfo> } Promise used to return the stream information.
6611     * @syscap SystemCapability.Multimedia.Audio.Renderer
6612     * @crossplatform
6613     * @since 12
6614     */
6615    getStreamInfo(): Promise<AudioStreamInfo>;
6616    /**
6617     * Obtains the renderer stream information.
6618     * @returns { AudioStreamInfo } The stream information.
6619     * @syscap SystemCapability.Multimedia.Audio.Renderer
6620     * @since 10
6621     */
6622    /**
6623     * Obtains the renderer stream information.
6624     * @returns { AudioStreamInfo } The stream information.
6625     * @syscap SystemCapability.Multimedia.Audio.Renderer
6626     * @crossplatform
6627     * @since 12
6628     */
6629    getStreamInfoSync(): AudioStreamInfo;
6630
6631    /**
6632     * Obtains the renderer stream id. This method uses an asynchronous callback to return the result.
6633     * @param { AsyncCallback<number> } callback - Callback used to return the stream id.
6634     * @syscap SystemCapability.Multimedia.Audio.Renderer
6635     * @since 9
6636     */
6637    /**
6638     * Obtains the renderer stream id. This method uses an asynchronous callback to return the result.
6639     * @param { AsyncCallback<number> } callback - Callback used to return the stream id.
6640     * @syscap SystemCapability.Multimedia.Audio.Renderer
6641     * @crossplatform
6642     * @since 12
6643     */
6644    getAudioStreamId(callback: AsyncCallback<number>): void;
6645    /**
6646     * Obtains the renderer stream id. This method uses a promise to return the result.
6647     * @returns { Promise<number> } Promise used to return the stream id.
6648     * @syscap SystemCapability.Multimedia.Audio.Renderer
6649     * @since 9
6650     */
6651    /**
6652     * Obtains the renderer stream id. This method uses a promise to return the result.
6653     * @returns { Promise<number> } Promise used to return the stream id.
6654     * @syscap SystemCapability.Multimedia.Audio.Renderer
6655     * @crossplatform
6656     * @since 12
6657     */
6658    getAudioStreamId(): Promise<number>;
6659    /**
6660     * Obtains the renderer stream id.
6661     * @returns { number } The stream id.
6662     * @syscap SystemCapability.Multimedia.Audio.Renderer
6663     * @since 10
6664     */
6665    /**
6666     * Obtains the renderer stream id.
6667     * @returns { number } The stream id.
6668     * @syscap SystemCapability.Multimedia.Audio.Renderer
6669     * @crossplatform
6670     * @since 12
6671     */
6672    getAudioStreamIdSync(): number;
6673
6674    /**
6675     * Obtains the current audio effect mode. This method uses an asynchronous callback to return the query result.
6676     * @param { AsyncCallback<AudioEffectMode> } callback - Callback used to return the current audio effect mode.
6677     * @syscap SystemCapability.Multimedia.Audio.Renderer
6678     * @since 10
6679     */
6680    getAudioEffectMode(callback: AsyncCallback<AudioEffectMode>): void;
6681    /**
6682     * Obtains the current audio effect mode. This method uses a promise to return the query result.
6683     * @returns { Promise<AudioEffectMode> } Promise used to return the current audio effect mode.
6684     * @syscap SystemCapability.Multimedia.Audio.Renderer
6685     * @since 10
6686     */
6687    getAudioEffectMode(): Promise<AudioEffectMode>;
6688
6689    /**
6690     * Sets the current audio effect mode. This method uses an asynchronous callback to return the result.
6691     * @param { AudioEffectMode } mode - Audio effect mode.
6692     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6693     * @throws { BusinessError } 401 - Parameter error. Possible causes:
6694     *                                 1.Mandatory parameters are left unspecified;
6695     *                                 2.Incorrect parameter types.
6696     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by callback.
6697     * @syscap SystemCapability.Multimedia.Audio.Renderer
6698     * @since 10
6699     */
6700    setAudioEffectMode(mode: AudioEffectMode, callback: AsyncCallback<void>): void;
6701    /**
6702     * Sets the current audio effect mode. This method uses a promise to return the result.
6703     * @param { AudioEffectMode } mode - Audio effect mode.
6704     * @returns { Promise<void> } Promise used to return the result.
6705     * @throws { BusinessError } 401 - Parameter error. Possible causes:
6706     *                                 1.Mandatory parameters are left unspecified;
6707     *                                 2.Incorrect parameter types.
6708     * @throws { BusinessError } 6800101 - Parameter verification failed. Return by promise.
6709     * @syscap SystemCapability.Multimedia.Audio.Renderer
6710     * @since 10
6711     */
6712    setAudioEffectMode(mode: AudioEffectMode): Promise<void>;
6713
6714    /**
6715     * Starts the renderer.
6716     * Success: This method uses an asynchronous callback to return the result.
6717     * Failure: This method uses an asynchronous callback to return the error instance. Possible causes:
6718     *          6800301: Unsupported state, Audio focus request failed, System error.
6719     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6720     * @syscap SystemCapability.Multimedia.Audio.Renderer
6721     * @since 8
6722     */
6723    /**
6724     * Starts the renderer. This method uses an asynchronous callback to return the result.
6725     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6726     * @syscap SystemCapability.Multimedia.Audio.Renderer
6727     * @crossplatform
6728     * @since 12
6729     */
6730    start(callback: AsyncCallback<void>): void;
6731    /**
6732     * Starts the renderer.
6733     * Success: This method uses a promise to return the result.
6734     * Failure: This method uses a promise to return the error instance. Possible causes:
6735     *          6800301: Unsupported state, Audio focus request failed, System error.
6736     * @returns { Promise<void> } Promise used to return the result.
6737     * @syscap SystemCapability.Multimedia.Audio.Renderer
6738     * @since 8
6739     */
6740    /**
6741     * Starts the renderer. This method uses a promise to return the result.
6742     * @returns { Promise<void> } Promise used to return the result.
6743     * @syscap SystemCapability.Multimedia.Audio.Renderer
6744     * @crossplatform
6745     * @since 12
6746     */
6747    start(): Promise<void>;
6748
6749    /**
6750     * Writes the buffer. This method uses an asynchronous callback to return the result.
6751     * @param { ArrayBuffer } buffer - Buffer to be written.
6752     * @param { AsyncCallback<number> } callback - Returns the number of bytes written if the operation is successful.
6753     *        Returns an error code otherwise.
6754     * @syscap SystemCapability.Multimedia.Audio.Renderer
6755     * @since 8
6756     * @deprecated since 11
6757     * @useinstead ohos.multimedia.audio.AudioRenderer#event:writeData
6758     */
6759    write(buffer: ArrayBuffer, callback: AsyncCallback<number>): void;
6760    /**
6761     * Writes the buffer. This method uses a promise to return the result.
6762     * @param { ArrayBuffer } buffer - Buffer to be written.
6763     * @returns { Promise<number> } Returns the number of bytes written if the operation is successful.
6764     *          Returns an error code otherwise.
6765     * @syscap SystemCapability.Multimedia.Audio.Renderer
6766     * @since 8
6767     * @deprecated since 11
6768     * @useinstead ohos.multimedia.audio.AudioRenderer#event:writeData
6769     */
6770    write(buffer: ArrayBuffer): Promise<number>;
6771
6772    /**
6773     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an
6774     * asynchronous callback to return the result.
6775     * @param { AsyncCallback<number> } callback - Callback used to return the timestamp.
6776     * @syscap SystemCapability.Multimedia.Audio.Renderer
6777     * @since 8
6778     */
6779    /**
6780     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an
6781     * asynchronous callback to return the result.
6782     * @param { AsyncCallback<number> } callback - Callback used to return the timestamp.
6783     * @syscap SystemCapability.Multimedia.Audio.Renderer
6784     * @crossplatform
6785     * @since 12
6786     */
6787    getAudioTime(callback: AsyncCallback<number>): void;
6788    /**
6789     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a
6790     * promise to return the result.
6791     * @returns { Promise<number> } Promise used to return the timestamp.
6792     * @syscap SystemCapability.Multimedia.Audio.Renderer
6793     * @since 8
6794     */
6795    /**
6796     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a
6797     * promise to return the result.
6798     * @returns { Promise<number> } Promise used to return the timestamp.
6799     * @syscap SystemCapability.Multimedia.Audio.Renderer
6800     * @crossplatform
6801     * @since 12
6802     */
6803    getAudioTime(): Promise<number>;
6804    /**
6805     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds.
6806     * @returns { number } The audio timestamp.
6807     * @syscap SystemCapability.Multimedia.Audio.Renderer
6808     * @since 10
6809     */
6810    /**
6811     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds.
6812     * @returns { number } The audio timestamp.
6813     * @syscap SystemCapability.Multimedia.Audio.Renderer
6814     * @crossplatform
6815     * @since 12
6816     */
6817    getAudioTimeSync(): number;
6818
6819    /**
6820     * Drains the playback buffer. This method uses an asynchronous callback to return the result.
6821     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6822     * @syscap SystemCapability.Multimedia.Audio.Renderer
6823     * @since 8
6824     */
6825    /**
6826     * Drains the playback buffer. This method uses an asynchronous callback to return the result.
6827     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6828     * @syscap SystemCapability.Multimedia.Audio.Renderer
6829     * @crossplatform
6830     * @since 12
6831     */
6832    drain(callback: AsyncCallback<void>): void;
6833    /**
6834     * Drains the playback buffer. This method uses a promise to return the result.
6835     * @returns { Promise<void> } Promise used to return the result.
6836     * @syscap SystemCapability.Multimedia.Audio.Renderer
6837     * @since 8
6838     */
6839    /**
6840     * Drains the playback buffer. This method uses a promise to return the result.
6841     * @returns { Promise<void> } Promise used to return the result.
6842     * @syscap SystemCapability.Multimedia.Audio.Renderer
6843     * @crossplatform
6844     * @since 12
6845     */
6846    drain(): Promise<void>;
6847
6848    /**
6849     * Flushes the playback buffer. This method uses a promise to return the result.
6850     * @returns { Promise<void> } Promise used to return the result.
6851     * @throws { BusinessError } 6800103 - Operation not permit at current state. Return by promise.
6852     * @syscap SystemCapability.Multimedia.Audio.Renderer
6853     * @since 11
6854     */
6855    /**
6856     * Flushes the playback buffer. This method uses a promise to return the result.
6857     * @returns { Promise<void> } Promise used to return the result.
6858     * @throws { BusinessError } 6800103 - Operation not permit at current state. Return by promise.
6859     * @syscap SystemCapability.Multimedia.Audio.Renderer
6860     * @crossplatform
6861     * @since 12
6862     */
6863    flush(): Promise<void>;
6864
6865    /**
6866     * Pauses rendering. This method uses an asynchronous callback to return the result.
6867     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6868     * @syscap SystemCapability.Multimedia.Audio.Renderer
6869     * @since 8
6870     */
6871    /**
6872     * Pauses rendering. This method uses an asynchronous callback to return the result.
6873     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6874     * @syscap SystemCapability.Multimedia.Audio.Renderer
6875     * @crossplatform
6876     * @since 12
6877     */
6878    pause(callback: AsyncCallback<void>): void;
6879    /**
6880     * Pauses rendering. This method uses a promise to return the result.
6881     * @returns { Promise<void> } Promise used to return the result.
6882     * @syscap SystemCapability.Multimedia.Audio.Renderer
6883     * @since 8
6884     */
6885    /**
6886     * Pauses rendering. This method uses a promise to return the result.
6887     * @returns { Promise<void> } Promise used to return the result.
6888     * @syscap SystemCapability.Multimedia.Audio.Renderer
6889     * @crossplatform
6890     * @since 12
6891     */
6892    pause(): Promise<void>;
6893
6894    /**
6895     * Stops rendering. This method uses an asynchronous callback to return the result.
6896     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6897     * @syscap SystemCapability.Multimedia.Audio.Renderer
6898     * @since 8
6899     */
6900    /**
6901     * Stops rendering. This method uses an asynchronous callback to return the result.
6902     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6903     * @syscap SystemCapability.Multimedia.Audio.Renderer
6904     * @crossplatform
6905     * @since 12
6906     */
6907    stop(callback: AsyncCallback<void>): void;
6908    /**
6909     * Stops rendering. This method uses a promise to return the result.
6910     * @returns { Promise<void> } Promise used to return the result.
6911     * @syscap SystemCapability.Multimedia.Audio.Renderer
6912     * @since 8
6913     */
6914    /**
6915     * Stops rendering. This method uses a promise to return the result.
6916     * @returns { Promise<void> } Promise used to return the result.
6917     * @syscap SystemCapability.Multimedia.Audio.Renderer
6918     * @crossplatform
6919     * @since 12
6920     */
6921    stop(): Promise<void>;
6922
6923    /**
6924     * Releases the renderer. This method uses an asynchronous callback to return the result.
6925     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6926     * @syscap SystemCapability.Multimedia.Audio.Renderer
6927     * @since 8
6928     */
6929    /**
6930     * Releases the renderer. This method uses an asynchronous callback to return the result.
6931     * @param { AsyncCallback<void> } callback - Callback used to return the result.
6932     * @syscap SystemCapability.Multimedia.Audio.Renderer
6933     * @crossplatform
6934     * @since 12
6935     */
6936    release(callback: AsyncCallback<void>): void;
6937    /**
6938     * Releases the renderer. This method uses a promise to return the result.
6939     * @returns { Promise<void> } Promise used to return the result.
6940     * @syscap SystemCapability.Multimedia.Audio.Renderer
6941     * @since 8
6942     */
6943    /**
6944     * Releases the renderer. This method uses a promise to return the result.
6945     * @returns { Promise<void> } Promise used to return the result.
6946     * @syscap SystemCapability.Multimedia.Audio.Renderer
6947     * @crossplatform
6948     * @since 12
6949     */
6950    release(): Promise<void>;
6951
6952    /**
6953     * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses an asynchronous callback to
6954     * return the result.
6955     * @param { AsyncCallback<number> } callback - Callback used to return the buffer size.
6956     * @syscap SystemCapability.Multimedia.Audio.Renderer
6957     * @since 8
6958     */
6959    /**
6960     * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses an asynchronous callback to
6961     * return the result.
6962     * @param { AsyncCallback<number> } callback - Callback used to return the buffer size.
6963     * @syscap SystemCapability.Multimedia.Audio.Renderer
6964     * @crossplatform
6965     * @since 12
6966     */
6967    getBufferSize(callback: AsyncCallback<number>): void;
6968    /**
6969     * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses a promise to return the result.
6970     * @returns { Promise<number> } Promise used to return the buffer size.
6971     * @syscap SystemCapability.Multimedia.Audio.Renderer
6972     * @since 8
6973     */
6974    /**
6975     * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses a promise to return the result.
6976     * @returns { Promise<number> } Promise used to return the buffer size.
6977     * @syscap SystemCapability.Multimedia.Audio.Renderer
6978     * @crossplatform
6979     * @since 12
6980     */
6981    getBufferSize(): Promise<number>;
6982    /**
6983     * Obtains a reasonable minimum buffer size in bytes for rendering.
6984     * @returns { number } The audio buffer size.
6985     * @syscap SystemCapability.Multimedia.Audio.Renderer
6986     * @since 10
6987     */
6988    /**
6989     * Obtains a reasonable minimum buffer size in bytes for rendering.
6990     * @returns { number } The audio buffer size.
6991     * @syscap SystemCapability.Multimedia.Audio.Renderer
6992     * @crossplatform
6993     * @since 12
6994     */
6995    getBufferSizeSync(): number;
6996
6997    /**
6998     * Sets the render rate. This method uses an asynchronous callback to return the result.
6999     * @param { AudioRendererRate } rate - Audio render rate.
7000     * @param { AsyncCallback<void> } callback - Callback used to return the result.
7001     * @syscap SystemCapability.Multimedia.Audio.Renderer
7002     * @since 8
7003     * @deprecated since 11
7004     * @useinstead ohos.multimedia.audio.AudioRenderer#setSpeed
7005     */
7006    setRenderRate(rate: AudioRendererRate, callback: AsyncCallback<void>): void;
7007
7008    /**
7009     * Sets the render rate. This method uses a promise to return the result.
7010     * @param { AudioRendererRate } rate - Audio render rate.
7011     * @returns { Promise<void> } Promise used to return the result.
7012     * @syscap SystemCapability.Multimedia.Audio.Renderer
7013     * @since 8
7014     * @deprecated since 11
7015     * @useinstead ohos.multimedia.audio.AudioRenderer#setSpeed
7016     */
7017    setRenderRate(rate: AudioRendererRate): Promise<void>;
7018
7019    /**
7020     * Sets the playback speed.
7021     * @param { number } speed -  Audio playback speed. The value type is float, form 0.25 to 4.0.
7022     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7023     *                                 1.Mandatory parameters are left unspecified;
7024     *                                 2.Incorrect parameter types.
7025     * @throws { BusinessError } 6800101 - Parameter verification failed.
7026     * @syscap SystemCapability.Multimedia.Audio.Renderer
7027     * @since 11
7028     */
7029    /**
7030     * Sets the playback speed.
7031     * @param { number } speed -  Audio playback speed. The value type is float, form 0.25 to 4.0.
7032     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7033     *                                 1.Mandatory parameters are left unspecified;
7034     *                                 2.Incorrect parameter types.
7035     * @throws { BusinessError } 6800101 - Parameter verification failed.
7036     * @syscap SystemCapability.Multimedia.Audio.Renderer
7037     * @crossplatform
7038     * @since 12
7039     */
7040    setSpeed(speed: number): void;
7041
7042    /**
7043     * Obtains the current render rate. This method uses an asynchronous callback to return the result.
7044     * @param { AsyncCallback<AudioRendererRate> } callback - Callback used to return the audio render rate.
7045     * @syscap SystemCapability.Multimedia.Audio.Renderer
7046     * @since 8
7047     * @deprecated since 11
7048     * @useinstead ohos.multimedia.audio.AudioRenderer#getSpeed
7049     */
7050    getRenderRate(callback: AsyncCallback<AudioRendererRate>): void;
7051
7052    /**
7053     * Obtains the current render rate. This method uses a promise to return the result.
7054     * @returns { Promise<AudioRendererRate> } Promise used to return the audio render rate.
7055     * @syscap SystemCapability.Multimedia.Audio.Renderer
7056     * @since 8
7057     * @deprecated since 11
7058     * @useinstead ohos.multimedia.audio.AudioRenderer#getSpeed
7059     */
7060    getRenderRate(): Promise<AudioRendererRate>;
7061
7062    /**
7063     * Obtains the current render rate.
7064     * @returns { AudioRendererRate } The audio render rate.
7065     * @syscap SystemCapability.Multimedia.Audio.Renderer
7066     * @since 10
7067     * @deprecated since 11
7068     * @useinstead ohos.multimedia.audio.AudioRenderer#getSpeed
7069     */
7070    getRenderRateSync(): AudioRendererRate;
7071
7072    /**
7073     * Obtains the current playback speed.
7074     * @returns { number } The playback speed.
7075     * @syscap SystemCapability.Multimedia.Audio.Renderer
7076     * @since 11
7077     */
7078    /**
7079     * Obtains the current playback speed.
7080     * @returns { number } The playback speed.
7081     * @syscap SystemCapability.Multimedia.Audio.Renderer
7082     * @crossplatform
7083     * @since 12
7084     */
7085    getSpeed(): number;
7086
7087    /**
7088     * Set interrupt mode.
7089     * @param { InterruptMode } mode - The interrupt mode.
7090     * @param { AsyncCallback<void> } callback - Callback used to return the result.
7091     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7092     * @since 9
7093     */
7094    /**
7095     * Set interrupt mode.
7096     * @param { InterruptMode } mode - The interrupt mode.
7097     * @param { AsyncCallback<void> } callback - Callback used to return the result.
7098     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7099     * @crossplatform
7100     * @since 12
7101     */
7102    setInterruptMode(mode: InterruptMode, callback: AsyncCallback<void>): void;
7103    /**
7104     * Set interrupt mode.
7105     * @param { InterruptMode } mode - The interrupt mode.
7106     * @returns { Promise<void> } Promise used to return the result.
7107     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7108     * @since 9
7109     */
7110    /**
7111     * Set interrupt mode.
7112     * @param { InterruptMode } mode - The interrupt mode.
7113     * @returns { Promise<void> } Promise used to return the result.
7114     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7115     * @crossplatform
7116     * @since 12
7117     */
7118    setInterruptMode(mode: InterruptMode): Promise<void>;
7119    /**
7120     * Set interrupt mode.
7121     * @param { InterruptMode } mode - The interrupt mode.
7122     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7123     *                                 1.Mandatory parameters are left unspecified;
7124     *                                 2.Incorrect parameter types.
7125     * @throws { BusinessError } 6800101 - Parameter verification failed.
7126     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7127     * @since 10
7128     */
7129    /**
7130     * Set interrupt mode.
7131     * @param { InterruptMode } mode - The interrupt mode.
7132     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7133     *                                 1.Mandatory parameters are left unspecified;
7134     *                                 2.Incorrect parameter types.
7135     * @throws { BusinessError } 6800101 - Parameter verification failed.
7136     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7137     * @crossplatform
7138     * @since 12
7139     */
7140    setInterruptModeSync(mode: InterruptMode): void;
7141
7142    /**
7143     * Sets the volume for this stream. This method uses an asynchronous callback to return the result.
7144     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7145     * @param { AsyncCallback<void> } callback - Callback used to return the result.
7146     * @syscap SystemCapability.Multimedia.Audio.Renderer
7147     * @since 9
7148     */
7149    /**
7150     * Sets the volume for this stream. This method uses an asynchronous callback to return the result.
7151     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7152     * @param { AsyncCallback<void> } callback - Callback used to return the result.
7153     * @syscap SystemCapability.Multimedia.Audio.Renderer
7154     * @crossplatform
7155     * @since 12
7156     */
7157    setVolume(volume: number, callback: AsyncCallback<void>): void;
7158    /**
7159     * Sets the volume for a stream. This method uses a promise to return the result.
7160     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7161     * @returns { Promise<void> } Promise used to return the result.
7162     * @syscap SystemCapability.Multimedia.Audio.Renderer
7163     * @since 9
7164     */
7165    /**
7166     * Sets the volume for a stream. This method uses a promise to return the result.
7167     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7168     * @returns { Promise<void> } Promise used to return the result.
7169     * @syscap SystemCapability.Multimedia.Audio.Renderer
7170     * @crossplatform
7171     * @since 12
7172     */
7173    setVolume(volume: number): Promise<void>;
7174
7175    /**
7176     * Gets volume of this stream.
7177     * @returns { number } Returns one float value.
7178     * @syscap SystemCapability.Multimedia.Audio.Renderer
7179     * @since 12
7180     */
7181    getVolume(): number;
7182
7183    /**
7184     * Changes the volume with ramp for a duration.
7185     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7186     * @param { number } duration -  Duration for volume ramp, in millisecond.
7187     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7188     *                                 1.Mandatory parameters are left unspecified;
7189     *                                 2.Incorrect parameter types.
7190     * @throws { BusinessError } 6800101 - Parameter verification failed.
7191     * @syscap SystemCapability.Multimedia.Audio.Renderer
7192     * @since 11
7193     */
7194    /**
7195     * Changes the volume with ramp for a duration.
7196     * @param { number } volume - Volume to set. The value type is float, form 0.0 to 1.0.
7197     * @param { number } duration -  Duration for volume ramp, in millisecond.
7198     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7199     *                                 1.Mandatory parameters are left unspecified;
7200     *                                 2.Incorrect parameter types.
7201     * @throws { BusinessError } 6800101 - Parameter verification failed.
7202     * @syscap SystemCapability.Multimedia.Audio.Renderer
7203     * @crossplatform
7204     * @since 12
7205     */
7206    setVolumeWithRamp(volume: number, duration: number): void;
7207
7208    /**
7209     * Gets the min volume this stream can set. This method uses an asynchronous callback to return the result.
7210     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7211     * @syscap SystemCapability.Multimedia.Audio.Renderer
7212     * @since 10
7213     */
7214    /**
7215     * Gets the min volume this stream can set. This method uses an asynchronous callback to return the result.
7216     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7217     * @syscap SystemCapability.Multimedia.Audio.Renderer
7218     * @crossplatform
7219     * @since 12
7220     */
7221    getMinStreamVolume(callback: AsyncCallback<number>): void;
7222    /**
7223     * Gets the min volume this stream can set. This method uses a promise to return the result.
7224     * @returns { Promise<number> } Promise used to return the result.
7225     * @syscap SystemCapability.Multimedia.Audio.Renderer
7226     * @since 10
7227     */
7228    /**
7229     * Gets the min volume this stream can set. This method uses a promise to return the result.
7230     * @returns { Promise<number> } Promise used to return the result.
7231     * @syscap SystemCapability.Multimedia.Audio.Renderer
7232     * @crossplatform
7233     * @since 12
7234     */
7235    getMinStreamVolume(): Promise<number>;
7236    /**
7237     * Gets the min volume this stream can set.
7238     * @returns { number } Min stream volume.
7239     * @syscap SystemCapability.Multimedia.Audio.Renderer
7240     * @since 10
7241     */
7242    /**
7243     * Gets the min volume this stream can set.
7244     * @returns { number } Min stream volume.
7245     * @syscap SystemCapability.Multimedia.Audio.Renderer
7246     * @crossplatform
7247     * @since 12
7248     */
7249    getMinStreamVolumeSync(): number;
7250
7251    /**
7252     * Gets the max volume this stream can set. This method uses an asynchronous callback to return the result.
7253     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7254     * @syscap SystemCapability.Multimedia.Audio.Renderer
7255     * @since 10
7256     */
7257    /**
7258     * Gets the max volume this stream can set. This method uses an asynchronous callback to return the result.
7259     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7260     * @syscap SystemCapability.Multimedia.Audio.Renderer
7261     * @crossplatform
7262     * @since 12
7263     */
7264    getMaxStreamVolume(callback: AsyncCallback<number>): void;
7265    /**
7266     * Gets the max volume this stream can set. This method uses a promise to return the result.
7267     * @returns { Promise<number> } Promise used to return the result.
7268     * @syscap SystemCapability.Multimedia.Audio.Renderer
7269     * @since 10
7270     */
7271    /**
7272     * Gets the max volume this stream can set. This method uses a promise to return the result.
7273     * @returns { Promise<number> } Promise used to return the result.
7274     * @syscap SystemCapability.Multimedia.Audio.Renderer
7275     * @crossplatform
7276     * @since 12
7277     */
7278    getMaxStreamVolume(): Promise<number>;
7279    /**
7280     * Gets the max volume this stream can set.
7281     * @returns { number } Max stream volume.
7282     * @syscap SystemCapability.Multimedia.Audio.Renderer
7283     * @since 10
7284     */
7285    /**
7286     * Gets the max volume this stream can set.
7287     * @returns { number } Max stream volume.
7288     * @syscap SystemCapability.Multimedia.Audio.Renderer
7289     * @crossplatform
7290     * @since 12
7291     */
7292    getMaxStreamVolumeSync(): number;
7293
7294    /**
7295     * Gets buffer underflow count. This method uses an asynchronous callback to return the result.
7296     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7297     * @syscap SystemCapability.Multimedia.Audio.Renderer
7298     * @since 10
7299     */
7300    /**
7301     * Gets buffer underflow count. This method uses an asynchronous callback to return the result.
7302     * @param { AsyncCallback<number> } callback - Callback used to return the result.
7303     * @syscap SystemCapability.Multimedia.Audio.Renderer
7304     * @crossplatform
7305     * @since 12
7306     */
7307    getUnderflowCount(callback: AsyncCallback<number>): void;
7308    /**
7309     * Gets buffer underflow count. This method uses a promise to return the result.
7310     * @returns { Promise<number> } Promise used to return the result.
7311     * @syscap SystemCapability.Multimedia.Audio.Renderer
7312     * @since 10
7313     */
7314    /**
7315     * Gets buffer underflow count. This method uses a promise to return the result.
7316     * @returns { Promise<number> } Promise used to return the result.
7317     * @syscap SystemCapability.Multimedia.Audio.Renderer
7318     * @crossplatform
7319     * @since 12
7320     */
7321    getUnderflowCount(): Promise<number>;
7322    /**
7323     * Gets buffer underflow count.
7324     * @returns { number } Underflow count number.
7325     * @syscap SystemCapability.Multimedia.Audio.Renderer
7326     * @since 10
7327     */
7328    /**
7329     * Gets buffer underflow count.
7330     * @returns { number } Underflow count number.
7331     * @syscap SystemCapability.Multimedia.Audio.Renderer
7332     * @crossplatform
7333     * @since 12
7334     */
7335    getUnderflowCountSync(): number;
7336
7337    /**
7338     * Gets the output device or devices for this stream.
7339     * This method uses an asynchronous callback to return the result.
7340     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
7341     * @syscap SystemCapability.Multimedia.Audio.Device
7342     * @since 10
7343     */
7344    /**
7345     * Gets the output device or devices for this stream.
7346     * This method uses an asynchronous callback to return the result.
7347     * @param { AsyncCallback<AudioDeviceDescriptors> } callback - Callback used to return the result.
7348     * @syscap SystemCapability.Multimedia.Audio.Device
7349     * @crossplatform
7350     * @since 12
7351     */
7352    getCurrentOutputDevices(callback: AsyncCallback<AudioDeviceDescriptors>): void;
7353    /**
7354     * Gets the output device or devices for this stream.
7355     * This method uses a promise to return the result.
7356     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
7357     * @syscap SystemCapability.Multimedia.Audio.Device
7358     * @since 10
7359     */
7360    /**
7361     * Gets the output device or devices for this stream.
7362     * This method uses a promise to return the result.
7363     * @returns { Promise<AudioDeviceDescriptors> } Promise used to return the result.
7364     * @syscap SystemCapability.Multimedia.Audio.Device
7365     * @crossplatform
7366     * @since 12
7367     */
7368    getCurrentOutputDevices(): Promise<AudioDeviceDescriptors>;
7369    /**
7370     * Gets the output device or devices for this stream.
7371     * @returns { AudioDeviceDescriptors } Output device or devices.
7372     * @syscap SystemCapability.Multimedia.Audio.Device
7373     * @since 10
7374     */
7375    /**
7376     * Gets the output device or devices for this stream.
7377     * @returns { AudioDeviceDescriptors } Output device or devices.
7378     * @syscap SystemCapability.Multimedia.Audio.Device
7379     * @crossplatform
7380     * @since 12
7381     */
7382    getCurrentOutputDevicesSync(): AudioDeviceDescriptors;
7383
7384    /**
7385     * Sets channel blend mode for this stream.
7386     * @param { ChannelBlendMode } mode - Target channel blend mode.
7387     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7388     *                                 1.Mandatory parameters are left unspecified;
7389     *                                 2.Incorrect parameter types.
7390     * @throws { BusinessError } 6800101 - Parameter verification failed.
7391     * @throws { BusinessError } 6800103 - Operation not permit at current state.
7392     * @syscap SystemCapability.Multimedia.Audio.Renderer
7393     * @since 11
7394     */
7395    /**
7396     * Sets channel blend mode for this stream.
7397     * @param { ChannelBlendMode } mode - Target channel blend mode.
7398     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7399     *                                 1.Mandatory parameters are left unspecified;
7400     *                                 2.Incorrect parameter types.
7401     * @throws { BusinessError } 6800101 - Parameter verification failed.
7402     * @throws { BusinessError } 6800103 - Operation not permit at current state.
7403     * @syscap SystemCapability.Multimedia.Audio.Renderer
7404     * @crossplatform
7405     * @since 12
7406     */
7407    setChannelBlendMode(mode: ChannelBlendMode): void;
7408
7409    /**
7410     * Sets silent and mix with other stream for this stream.
7411     * @param { boolean } on - Whether play silent and mix with other streams.
7412     *     true: set the silent mode and mix with other streams.
7413     *     false: unset the silent mode, current stream will trigger the audio focus internally.
7414     * @syscap SystemCapability.Multimedia.Audio.Renderer
7415     * @since 12
7416     */
7417    setSilentModeAndMixWithOthers(on: boolean): void;
7418
7419    /**
7420     * Gets silent and mix with other stream status for this stream.
7421     * @returns { boolean } Returns silent and mix with other stream status.
7422     *     true: current stream is in the silent mode and mix with other streams.
7423     *     false: current stream in in the normal playback mode
7424     * @syscap SystemCapability.Multimedia.Audio.Renderer
7425     * @since 12
7426     */
7427    getSilentModeAndMixWithOthers(): boolean;
7428
7429    /**
7430     * Temporarily changes the current audio device
7431     * This function applys on audiorenderers whose StreamUsage are
7432     * STREAM_USAGE_VOICE_COMMUNICATIN/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE.
7433     * Setting the device will only takes effect if no other accessory such as headphones are in use
7434     * @param { DeviceType } deviceType - the available deviceTypes are
7435     *                                    EARPIECE: Built-in earpiece
7436     *                                    SPEAKER: Built-in speaker
7437     *                                    DEFAULT: System default output device
7438     * @returns { Promise<void> } Promise used to return the result.
7439     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7440     *                                 1.Mandatory parameters are left unspecified;
7441     *                                 2.Incorrect parameter types.
7442     * @throws { BusinessError } 6800101 - Parameter verification failed.
7443     * @throws { BusinessError } 6800103 - Operation not permit at current state.
7444     * @syscap SystemCapability.Multimedia.Audio.Renderer
7445     * @since 12
7446     */
7447    setDefaultOutputDevice(deviceType: DeviceType): Promise<void>;
7448
7449    /**
7450     * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is
7451     * triggered when audio playback is interrupted.
7452     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
7453     * @param { Callback<InterruptEvent> } callback - Callback used to listen for interrupt callback.
7454     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7455     *                                 1.Mandatory parameters are left unspecified;
7456     *                                 2.Incorrect parameter types.
7457     * @throws { BusinessError } 6800101 - Parameter verification failed.
7458     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7459     * @since 9
7460     */
7461    /**
7462     * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is
7463     * triggered when audio playback is interrupted.
7464     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
7465     * @param { Callback<InterruptEvent> } callback - Callback used to listen for interrupt callback.
7466     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7467     *                                 1.Mandatory parameters are left unspecified;
7468     *                                 2.Incorrect parameter types.
7469     * @throws { BusinessError } 6800101 - Parameter verification failed.
7470     * @syscap SystemCapability.Multimedia.Audio.Interrupt
7471     * @crossplatform
7472     * @since 12
7473     */
7474    on(type: 'audioInterrupt', callback: Callback<InterruptEvent>): void;
7475
7476    /**
7477     * Subscribes to mark reached events. When the number of frames rendered reaches the value of the frame parameter,
7478     * the callback is invoked.
7479     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
7480     * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0.
7481     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
7482     * @syscap SystemCapability.Multimedia.Audio.Renderer
7483     * @since 8
7484     */
7485    /**
7486     * Subscribes to mark reached events. When the number of frames rendered reaches the value of the frame parameter,
7487     * the callback is invoked.
7488     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
7489     * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0.
7490     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
7491     * @syscap SystemCapability.Multimedia.Audio.Renderer
7492     * @crossplatform
7493     * @since 12
7494     */
7495    on(type: 'markReach', frame: number, callback: Callback<number>): void;
7496    /**
7497     * Unsubscribes from mark reached events.
7498     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
7499     * @syscap SystemCapability.Multimedia.Audio.Renderer
7500     * @since 8
7501     */
7502    /**
7503     * Unsubscribes from mark reached events.
7504     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
7505     * @syscap SystemCapability.Multimedia.Audio.Renderer
7506     * @crossplatform
7507     * @since 12
7508     */
7509    off(type: 'markReach'): void;
7510
7511    /**
7512     * Subscribes to period reached events. When the period of frame rendering reaches the value of frame parameter,
7513     * the callback is invoked.
7514     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
7515     * @param { number } frame - Period during which frame rendering is listened. The value must be greater than 0.
7516     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
7517     * @syscap SystemCapability.Multimedia.Audio.Renderer
7518     * @since 8
7519     */
7520    /**
7521     * Subscribes to period reached events. When the period of frame rendering reaches the value of frame parameter,
7522     * the callback is invoked.
7523     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
7524     * @param { number } frame - Period during which frame rendering is listened. The value must be greater than 0.
7525     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
7526     * @syscap SystemCapability.Multimedia.Audio.Renderer
7527     * @crossplatform
7528     * @since 12
7529     */
7530    on(type: 'periodReach', frame: number, callback: Callback<number>): void;
7531    /**
7532     * Unsubscribes from period reached events.
7533     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
7534     * @syscap SystemCapability.Multimedia.Audio.Renderer
7535     * @since 8
7536     */
7537    /**
7538     * Unsubscribes from period reached events.
7539     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
7540     * @syscap SystemCapability.Multimedia.Audio.Renderer
7541     * @crossplatform
7542     * @since 12
7543     */
7544    off(type: 'periodReach'): void;
7545
7546    /**
7547     * Subscribes audio state change event callback.
7548     * @param { 'stateChange' } type - Type of the event to listen for. Only the stateChange event is supported.
7549     * @param { Callback<AudioState> } callback - Callback invoked when state change.
7550     * @syscap SystemCapability.Multimedia.Audio.Renderer
7551     * @since 8
7552     */
7553    /**
7554     * Subscribes audio state change event callback.
7555     * @param { 'stateChange' } type - Type of the event to listen for. Only the stateChange event is supported.
7556     * @param { Callback<AudioState> } callback - Callback invoked when state change.
7557     * @syscap SystemCapability.Multimedia.Audio.Renderer
7558     * @crossplatform
7559     * @since 12
7560     */
7561    on(type: 'stateChange', callback: Callback<AudioState>): void;
7562
7563    /**
7564     * Subscribes output device change event callback.
7565     * The event is triggered when output device change for this stream.
7566     * @param { 'outputDeviceChange' } type - Type of the event to listen for.
7567     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to listen device change event.
7568     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7569     *                                 1.Mandatory parameters are left unspecified;
7570     *                                 2.Incorrect parameter types.
7571     * @throws { BusinessError } 6800101 - Parameter verification failed.
7572     * @syscap SystemCapability.Multimedia.Audio.Device
7573     * @since 10
7574     */
7575    /**
7576     * Subscribes output device change event callback.
7577     * The event is triggered when output device change for this stream.
7578     * @param { 'outputDeviceChange' } type - Type of the event to listen for.
7579     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to listen device change event.
7580     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7581     *                                 1.Mandatory parameters are left unspecified;
7582     *                                 2.Incorrect parameter types.
7583     * @throws { BusinessError } 6800101 - Parameter verification failed.
7584     * @syscap SystemCapability.Multimedia.Audio.Device
7585     * @crossplatform
7586     * @since 12
7587     */
7588    on(type: 'outputDeviceChange', callback: Callback<AudioDeviceDescriptors>): void;
7589
7590    /**
7591     * Subscribes output device change event callback.
7592     * The event is triggered when output device change for this stream.
7593     * @param { 'outputDeviceChangeWithInfo' } type - Type of the event to listen for.
7594     * @param { Callback<AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event.
7595     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7596     *                                 1.Mandatory parameters are left unspecified;
7597     *                                 2.Incorrect parameter types.
7598     * @throws { BusinessError } 6800101 - Parameter verification failed.
7599     * @syscap SystemCapability.Multimedia.Audio.Device
7600     * @since 11
7601     */
7602    /**
7603     * Subscribes output device change event callback.
7604     * The event is triggered when output device change for this stream.
7605     * @param { 'outputDeviceChangeWithInfo' } type - Type of the event to listen for.
7606     * @param { Callback<AudioStreamDeviceChangeInfo> } callback - Callback used to listen device change event.
7607     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7608     *                                 1.Mandatory parameters are left unspecified;
7609     *                                 2.Incorrect parameter types.
7610     * @throws { BusinessError } 6800101 - Parameter verification failed.
7611     * @syscap SystemCapability.Multimedia.Audio.Device
7612     * @crossplatform
7613     * @since 12
7614     */
7615    on(type: 'outputDeviceChangeWithInfo', callback: Callback<AudioStreamDeviceChangeInfo>): void;
7616
7617    /**
7618     * Unsubscribes output device change event callback.
7619     * @param { 'outputDeviceChange' } type - Type of the event to listen for.
7620     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used in subscribe.
7621     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7622     *                                 1.Mandatory parameters are left unspecified;
7623     *                                 2.Incorrect parameter types.
7624     * @throws { BusinessError } 6800101 - Parameter verification failed.
7625     * @syscap SystemCapability.Multimedia.Audio.Device
7626     * @since 10
7627     */
7628    /**
7629     * Unsubscribes output device change event callback.
7630     * @param { 'outputDeviceChange' } type - Type of the event to listen for.
7631     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used in subscribe.
7632     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7633     *                                 1.Mandatory parameters are left unspecified;
7634     *                                 2.Incorrect parameter types.
7635     * @throws { BusinessError } 6800101 - Parameter verification failed.
7636     * @syscap SystemCapability.Multimedia.Audio.Device
7637     * @crossplatform
7638     * @since 12
7639     */
7640    off(type: 'outputDeviceChange', callback?: Callback<AudioDeviceDescriptors>): void;
7641
7642    /**
7643     * Unsubscribes output device change event callback.
7644     * @param { 'outputDeviceChangeWithInfo' } type - Type of the event to listen for.
7645     * @param { Callback<AudioStreamDeviceChangeInfo> } callback - Callback used in subscribe.
7646     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7647     *                                 1.Mandatory parameters are left unspecified;
7648     *                                 2.Incorrect parameter types.
7649     * @throws { BusinessError } 6800101 - Parameter verification failed.
7650     * @syscap SystemCapability.Multimedia.Audio.Device
7651     * @since 11
7652     */
7653    /**
7654     * Unsubscribes output device change event callback.
7655     * @param { 'outputDeviceChangeWithInfo' } type - Type of the event to listen for.
7656     * @param { Callback<AudioStreamDeviceChangeInfo> } callback - Callback used in subscribe.
7657     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7658     *                                 1.Mandatory parameters are left unspecified;
7659     *                                 2.Incorrect parameter types.
7660     * @throws { BusinessError } 6800101 - Parameter verification failed.
7661     * @syscap SystemCapability.Multimedia.Audio.Device
7662     * @crossplatform
7663     * @since 12
7664     */
7665    off(type: 'outputDeviceChangeWithInfo', callback?: Callback<AudioStreamDeviceChangeInfo>): void;
7666
7667    /**
7668     * Subscribes audio data callback.
7669     * The event is triggered when audio buffer is available for writing more data.
7670     * @param { 'writeData' } type - Type of the event to listen for.
7671     * @param { Callback<ArrayBuffer> } callback - Callback with buffer to write.
7672     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7673     *                                 1.Mandatory parameters are left unspecified;
7674     *                                 2.Incorrect parameter types.
7675     * @throws { BusinessError } 6800101 - Parameter verification failed.
7676     * @syscap SystemCapability.Multimedia.Audio.Renderer
7677     * @since 11
7678     */
7679    /**
7680     * Subscribes audio data callback.
7681     * The event is triggered when audio buffer is available for writing more data.
7682     * @param { 'writeData' } type - Type of the event to listen for.
7683     * @param { AudioRendererWriteDataCallback } callback - Audio renderer write data callback.
7684     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7685     *                                 1.Mandatory parameters are left unspecified;
7686     *                                 2.Incorrect parameter types.
7687     * @throws { BusinessError } 6800101 - Parameter verification failed.
7688     * @syscap SystemCapability.Multimedia.Audio.Renderer
7689     * @crossplatform
7690     * @since 12
7691     */
7692    on(type: 'writeData', callback: AudioRendererWriteDataCallback): void;
7693
7694    /**
7695     * Unsubscribes audio data callback.
7696     * @param { 'writeData' } type - Type of the event to listen for.
7697     * @param { Callback<ArrayBuffer> } callback - Callback used in subscribe.
7698     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7699     *                                 1.Mandatory parameters are left unspecified;
7700     *                                 2.Incorrect parameter types.
7701     * @throws { BusinessError } 6800101 - Parameter verification failed.
7702     * @syscap SystemCapability.Multimedia.Audio.Renderer
7703     * @since 11
7704     */
7705    /**
7706     * Unsubscribes audio data callback.
7707     * @param { 'writeData' } type - Type of the event to listen for.
7708     * @param { AudioRendererWriteDataCallback } callback - Audio renderer write data callback.
7709     * @throws { BusinessError } 401 - Parameter error. Possible causes:
7710     *                                 1.Mandatory parameters are left unspecified;
7711     *                                 2.Incorrect parameter types.
7712     * @throws { BusinessError } 6800101 - Parameter verification failed.
7713     * @syscap SystemCapability.Multimedia.Audio.Renderer
7714     * @crossplatform
7715     * @since 12
7716     */
7717    off(type: 'writeData', callback?: AudioRendererWriteDataCallback): void;
7718  }
7719
7720  /**
7721   * Enumerates source types.
7722   * @enum { number }
7723   * @syscap SystemCapability.Multimedia.Audio.Core
7724   * @since 8
7725   */
7726  /**
7727   * Enumerates source types.
7728   * @enum { number }
7729   * @syscap SystemCapability.Multimedia.Audio.Core
7730   * @crossplatform
7731   * @since 12
7732   */
7733  enum SourceType {
7734    /**
7735     * Invalid source type.
7736     * @syscap SystemCapability.Multimedia.Audio.Core
7737     * @since 8
7738     */
7739    SOURCE_TYPE_INVALID = -1,
7740    /**
7741     * Mic source type.
7742     * @syscap SystemCapability.Multimedia.Audio.Core
7743     * @since 8
7744     */
7745    /**
7746     * Mic source type.
7747     * @syscap SystemCapability.Multimedia.Audio.Core
7748     * @crossplatform
7749     * @since 12
7750     */
7751    SOURCE_TYPE_MIC = 0,
7752    /**
7753     * Voice recognition source type.
7754     * @syscap SystemCapability.Multimedia.Audio.Core
7755     * @since 9
7756     */
7757    /**
7758     * Voice recognition source type.
7759     * @syscap SystemCapability.Multimedia.Audio.Core
7760     * @crossplatform
7761     * @since 12
7762     */
7763    SOURCE_TYPE_VOICE_RECOGNITION = 1,
7764    /**
7765     * Playback capture source type.
7766     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7767     * @since 10
7768     * @deprecated since 12
7769     * @useinstead OH_AVScreenCapture in native interface.
7770     */
7771    SOURCE_TYPE_PLAYBACK_CAPTURE = 2,
7772    /**
7773     * Wakeup source type.
7774     * Permission ohos.permission.MANAGE_INTELLIGENT_VOICE is needed when calling createAudioCapturer with this type.
7775     * @syscap SystemCapability.Multimedia.Audio.Core
7776     * @systemapi
7777     * @since 10
7778     */
7779    SOURCE_TYPE_WAKEUP = 3,
7780
7781    /**
7782     * Voice call source type.
7783     * Permission ohos.permission.RECORD_VOICE_CALL is needed when calling createAudioCapturer with this type.
7784     * @syscap SystemCapability.Multimedia.Audio.Core
7785     * @systemapi
7786     * @since 11
7787     */
7788    SOURCE_TYPE_VOICE_CALL = 4,
7789
7790    /**
7791     * Voice communication source type.
7792     * @syscap SystemCapability.Multimedia.Audio.Core
7793     * @since 8
7794     */
7795    /**
7796     * Voice communication source type.
7797     * @syscap SystemCapability.Multimedia.Audio.Core
7798     * @crossplatform
7799     * @since 12
7800     */
7801    SOURCE_TYPE_VOICE_COMMUNICATION = 7,
7802
7803    /**
7804     * Voice message source type.
7805     * @syscap SystemCapability.Multimedia.Audio.Core
7806     * @since 12
7807     */
7808    SOURCE_TYPE_VOICE_MESSAGE = 10,
7809
7810    /**
7811     * Camcorder source type.
7812     * @syscap SystemCapability.Multimedia.Audio.Core
7813     * @since 13
7814     */
7815    SOURCE_TYPE_CAMCORDER = 13,
7816  }
7817
7818  /**
7819   * Describes audio capturer information.
7820   * @typedef AudioCapturerInfo
7821   * @syscap SystemCapability.Multimedia.Audio.Core
7822   * @since 8
7823   */
7824  /**
7825   * Describes audio capturer information.
7826   * @typedef AudioCapturerInfo
7827   * @syscap SystemCapability.Multimedia.Audio.Core
7828   * @crossplatform
7829   * @since 12
7830   */
7831  interface AudioCapturerInfo {
7832    /**
7833     * Audio source type.
7834     * @type { SourceType }
7835     * @syscap SystemCapability.Multimedia.Audio.Core
7836     * @since 8
7837     */
7838    /**
7839     * Audio source type.
7840     * @type { SourceType }
7841     * @syscap SystemCapability.Multimedia.Audio.Core
7842     * @crossplatform
7843     * @since 12
7844     */
7845    source: SourceType;
7846    /**
7847     * Audio capturer flags.
7848     * @type { number }
7849     * @syscap SystemCapability.Multimedia.Audio.Core
7850     * @since 8
7851     */
7852    /**
7853     * Audio capturer flags.
7854     * @type { number }
7855     * @syscap SystemCapability.Multimedia.Audio.Core
7856     * @crossplatform
7857     * @since 12
7858     */
7859    capturerFlags: number;
7860  }
7861
7862  /**
7863   * Describes audio capturer configuration options.
7864   * @typedef AudioCapturerOptions
7865   * @syscap SystemCapability.Multimedia.Audio.Capturer
7866   * @since 8
7867   */
7868  /**
7869   * Describes audio capturer configuration options.
7870   * @typedef AudioCapturerOptions
7871   * @syscap SystemCapability.Multimedia.Audio.Capturer
7872   * @crossplatform
7873   * @since 12
7874   */
7875  interface AudioCapturerOptions {
7876    /**
7877     * Stream information.
7878     * @type { AudioStreamInfo }
7879     * @syscap SystemCapability.Multimedia.Audio.Capturer
7880     * @since 8
7881     */
7882    /**
7883     * Stream information.
7884     * @type { AudioStreamInfo }
7885     * @syscap SystemCapability.Multimedia.Audio.Capturer
7886     * @crossplatform
7887     * @since 12
7888     */
7889    streamInfo: AudioStreamInfo;
7890    /**
7891     * Capturer information.
7892     * @type { AudioCapturerInfo }
7893     * @syscap SystemCapability.Multimedia.Audio.Capturer
7894     * @since 8
7895     */
7896    /**
7897     * Capturer information.
7898     * @type { AudioCapturerInfo }
7899     * @syscap SystemCapability.Multimedia.Audio.Capturer
7900     * @crossplatform
7901     * @since 12
7902     */
7903    capturerInfo: AudioCapturerInfo;
7904    /**
7905     * Playback capture config.
7906     * @type { ?AudioPlaybackCaptureConfig }
7907     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7908     * @since 10
7909     * @deprecated since 12
7910     * @useinstead OH_AVScreenCapture in native interface.
7911     */
7912    playbackCaptureConfig?: AudioPlaybackCaptureConfig;
7913  }
7914
7915  /**
7916   * Describe playback capture filtering options
7917   * @typedef CaptureFilterOptions
7918   * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7919   * @since 10
7920   * @deprecated since 12
7921   * @useinstead OH_AVScreenCapture in native interface.
7922   */
7923  interface CaptureFilterOptions {
7924    /**
7925     * Filter by stream usages. If you want to capture voice streams, additional permission is needed.
7926     * @type { Array<StreamUsage> }
7927     * @permission ohos.permission.CAPTURE_VOICE_DOWNLINK_AUDIO
7928     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7929     * @since 10
7930     */
7931    /**
7932     * Filter by stream usages. But not allow to capture voice streams.
7933     * @type { Array<StreamUsage> }
7934     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7935     * @since 11
7936     * @deprecated since 12
7937     * @useinstead OH_AVScreenCapture in native interface.
7938     */
7939    usages: Array<StreamUsage>;
7940  }
7941
7942  /**
7943   * Describe playback capture config object.
7944   * @typedef AudioPlaybackCaptureConfig
7945   * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7946   * @since 10
7947   * @deprecated since 12
7948   * @useinstead OH_AVScreenCapture in native interface.
7949   */
7950  interface AudioPlaybackCaptureConfig {
7951    /**
7952     * Add filter options to decide which streams to be captured.
7953     * @type { CaptureFilterOptions }
7954     * @syscap SystemCapability.Multimedia.Audio.PlaybackCapture
7955     * @since 10
7956     * @deprecated since 12
7957     * @useinstead OH_AVScreenCapture in native interface.
7958     */
7959    filterOptions: CaptureFilterOptions;
7960  }
7961
7962  /**
7963   * Provides APIs for audio recording.
7964   * @typedef AudioCapturer
7965   * @syscap SystemCapability.Multimedia.Audio.Capturer
7966   * @since 8
7967   */
7968  /**
7969   * Provides APIs for audio recording.
7970   * @typedef AudioCapturer
7971   * @syscap SystemCapability.Multimedia.Audio.Capturer
7972   * @crossplatform
7973   * @since 12
7974   */
7975  interface AudioCapturer {
7976    /**
7977     * Defines the current capture state.
7978     * @type { AudioState }
7979     * @syscap SystemCapability.Multimedia.Audio.Capturer
7980     * @since 8
7981     */
7982    /**
7983     * Defines the current capture state.
7984     * @type { AudioState }
7985     * @syscap SystemCapability.Multimedia.Audio.Capturer
7986     * @crossplatform
7987     * @since 12
7988     */
7989    readonly state: AudioState;
7990
7991    /**
7992     * Obtains the capturer information provided while creating a capturer instance. This method uses an asynchronous
7993     * callback to return the result.
7994     * @param { AsyncCallback<AudioCapturerInfo> } callback - Callback used to return the capturer information.
7995     * @syscap SystemCapability.Multimedia.Audio.Capturer
7996     * @since 8
7997     */
7998    /**
7999     * Obtains the capturer information provided while creating a capturer instance. This method uses an asynchronous
8000     * callback to return the result.
8001     * @param { AsyncCallback<AudioCapturerInfo> } callback - Callback used to return the capturer information.
8002     * @syscap SystemCapability.Multimedia.Audio.Capturer
8003     * @crossplatform
8004     * @since 12
8005     */
8006    getCapturerInfo(callback: AsyncCallback<AudioCapturerInfo>): void;
8007    /**
8008     * Obtains the capturer information provided while creating a capturer instance. This method uses a promise to
8009     * return the result.
8010     * @returns { Promise<AudioCapturerInfo> } Promise used to return the capturer information.
8011     * @syscap SystemCapability.Multimedia.Audio.Capturer
8012     * @since 8
8013     */
8014    /**
8015     * Obtains the capturer information provided while creating a capturer instance. This method uses a promise to
8016     * return the result.
8017     * @returns { Promise<AudioCapturerInfo> } Promise used to return the capturer information.
8018     * @syscap SystemCapability.Multimedia.Audio.Capturer
8019     * @crossplatform
8020     * @since 12
8021     */
8022    getCapturerInfo(): Promise<AudioCapturerInfo>;
8023    /**
8024     * Obtains the capturer information provided while creating a capturer instance.
8025     * @returns { AudioCapturerInfo } The capturer information.
8026     * @syscap SystemCapability.Multimedia.Audio.Capturer
8027     * @since 10
8028     */
8029    /**
8030     * Obtains the capturer information provided while creating a capturer instance.
8031     * @returns { AudioCapturerInfo } The capturer information.
8032     * @syscap SystemCapability.Multimedia.Audio.Capturer
8033     * @crossplatform
8034     * @since 12
8035     */
8036    getCapturerInfoSync(): AudioCapturerInfo;
8037
8038    /**
8039     * Obtains the capturer stream information. This method uses an asynchronous callback to return the result.
8040     * @param { AsyncCallback<AudioStreamInfo> } callback - Callback used to return the stream information.
8041     * @syscap SystemCapability.Multimedia.Audio.Capturer
8042     * @since 8
8043     */
8044    /**
8045     * Obtains the capturer stream information. This method uses an asynchronous callback to return the result.
8046     * @param { AsyncCallback<AudioStreamInfo> } callback - Callback used to return the stream information.
8047     * @syscap SystemCapability.Multimedia.Audio.Capturer
8048     * @crossplatform
8049     * @since 12
8050     */
8051    getStreamInfo(callback: AsyncCallback<AudioStreamInfo>): void;
8052    /**
8053     * Obtains the capturer stream information. This method uses a promise to return the result.
8054     * @returns { Promise<AudioStreamInfo> } Promise used to return the stream information.
8055     * @syscap SystemCapability.Multimedia.Audio.Capturer
8056     * @since 8
8057     */
8058    /**
8059     * Obtains the capturer stream information. This method uses a promise to return the result.
8060     * @returns { Promise<AudioStreamInfo> } Promise used to return the stream information.
8061     * @syscap SystemCapability.Multimedia.Audio.Capturer
8062     * @crossplatform
8063     * @since 12
8064     */
8065    getStreamInfo(): Promise<AudioStreamInfo>;
8066    /**
8067     * Obtains the capturer stream information.
8068     * @returns { AudioStreamInfo } The stream information.
8069     * @syscap SystemCapability.Multimedia.Audio.Capturer
8070     * @since 10
8071     */
8072    /**
8073     * Obtains the capturer stream information.
8074     * @returns { AudioStreamInfo } The stream information.
8075     * @syscap SystemCapability.Multimedia.Audio.Capturer
8076     * @crossplatform
8077     * @since 12
8078     */
8079    getStreamInfoSync(): AudioStreamInfo;
8080
8081    /**
8082     * Obtains the capturer stream id. This method uses an asynchronous callback to return the result.
8083     * @param { AsyncCallback<number> } callback - Callback used to return the stream id.
8084     * @syscap SystemCapability.Multimedia.Audio.Capturer
8085     * @since 9
8086     */
8087    /**
8088     * Obtains the capturer stream id. This method uses an asynchronous callback to return the result.
8089     * @param { AsyncCallback<number> } callback - Callback used to return the stream id.
8090     * @syscap SystemCapability.Multimedia.Audio.Capturer
8091     * @crossplatform
8092     * @since 12
8093     */
8094    getAudioStreamId(callback: AsyncCallback<number>): void;
8095    /**
8096     * Obtains the capturer stream id. This method uses a promise to return the result.
8097     * @returns { Promise<number> } Promise used to return the stream id.
8098     * @syscap SystemCapability.Multimedia.Audio.Capturer
8099     * @since 9
8100     */
8101    /**
8102     * Obtains the capturer stream id. This method uses a promise to return the result.
8103     * @returns { Promise<number> } Promise used to return the stream id.
8104     * @syscap SystemCapability.Multimedia.Audio.Capturer
8105     * @crossplatform
8106     * @since 12
8107     */
8108    getAudioStreamId(): Promise<number>;
8109    /**
8110     * Obtains the capturer stream id.
8111     * @returns { number } The stream id.
8112     * @syscap SystemCapability.Multimedia.Audio.Capturer
8113     * @since 10
8114     */
8115    /**
8116     * Obtains the capturer stream id.
8117     * @returns { number } The stream id.
8118     * @syscap SystemCapability.Multimedia.Audio.Capturer
8119     * @crossplatform
8120     * @since 12
8121     */
8122    getAudioStreamIdSync(): number;
8123
8124    /**
8125     * Starts capturing.
8126     * Success: This method uses an asynchronous callback to return the result.
8127     * Failure: This method uses an asynchronous callback to return the error instance. Possible causes:
8128     *          6800301: Unsupported state, Audio focus request failed, System error.
8129     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8130     * @syscap SystemCapability.Multimedia.Audio.Capturer
8131     * @since 8
8132     */
8133    /**
8134     * Starts capturing. This method uses an asynchronous callback to return the result.
8135     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8136     * @syscap SystemCapability.Multimedia.Audio.Capturer
8137     * @crossplatform
8138     * @since 12
8139     */
8140    start(callback: AsyncCallback<void>): void;
8141    /**
8142     * Starts capturing.
8143     * Success: This method uses a promise to return the result.
8144     * Failure: This method uses a promise to return the error instance. Possible causes:
8145     *          6800301: Unsupported state, Audio focus request failed, System error.
8146     * @returns { Promise<void> } Promise used to return the result.
8147     * @syscap SystemCapability.Multimedia.Audio.Capturer
8148     * @since 8
8149     */
8150    /**
8151     * Starts capturing. This method uses a promise to return the result.
8152     * @returns { Promise<void> } Promise used to return the result.
8153     * @syscap SystemCapability.Multimedia.Audio.Capturer
8154     * @crossplatform
8155     * @since 12
8156     */
8157    start(): Promise<void>;
8158
8159    /**
8160     * Reads the buffer from the audio capturer. This method uses an asynchronous callback to return the result.
8161     * @param { number } size - Number of bytes to read.
8162     * @param { boolean } isBlockingRead - Whether the read operation should be blocked.
8163     * @param { AsyncCallback<ArrayBuffer> } callback - Callback used to return the buffer.
8164     * @syscap SystemCapability.Multimedia.Audio.Capturer
8165     * @since 8
8166     * @deprecated since 11
8167     * @useinstead ohos.multimedia.audio.AudioCapturer#event:readData
8168     */
8169    read(size: number, isBlockingRead: boolean, callback: AsyncCallback<ArrayBuffer>): void;
8170    /**
8171     * Reads the buffer from the audio capturer. This method uses a promise to return the result.
8172     * @param { number } size - Number of bytes to read.
8173     * @param { boolean } isBlockingRead - Whether the read operation should be blocked.
8174     * @returns { Promise<ArrayBuffer> } Returns the buffer data read if the operation is successful.
8175     *          Returns an error code otherwise.
8176     * @syscap SystemCapability.Multimedia.Audio.Capturer
8177     * @since 8
8178     * @deprecated since 11
8179     * @useinstead ohos.multimedia.audio.AudioCapturer#event:readData
8180     */
8181    read(size: number, isBlockingRead: boolean): Promise<ArrayBuffer>;
8182
8183    /**
8184     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an
8185     * asynchronous callback to return the result.
8186     * @param { AsyncCallback<number> } callback - Callback used to return the timestamp.
8187     * @syscap SystemCapability.Multimedia.Audio.Capturer
8188     * @since 8
8189     */
8190    /**
8191     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an
8192     * asynchronous callback to return the result.
8193     * @param { AsyncCallback<number> } callback - Callback used to return the timestamp.
8194     * @syscap SystemCapability.Multimedia.Audio.Capturer
8195     * @crossplatform
8196     * @since 12
8197     */
8198    getAudioTime(callback: AsyncCallback<number>): void;
8199    /**
8200     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a
8201     * promise to return the result.
8202     * @returns { Promise<number> } Promise used to return the timestamp.
8203     * @syscap SystemCapability.Multimedia.Audio.Capturer
8204     * @since 8
8205     */
8206    /**
8207     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses a
8208     * promise to return the result.
8209     * @returns { Promise<number> } Promise used to return the timestamp.
8210     * @syscap SystemCapability.Multimedia.Audio.Capturer
8211     * @crossplatform
8212     * @since 12
8213     */
8214    getAudioTime(): Promise<number>;
8215    /**
8216     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds.
8217     * @returns { number } The audio timestamp.
8218     * @syscap SystemCapability.Multimedia.Audio.Capturer
8219     * @since 10
8220     */
8221    /**
8222     * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds.
8223     * @returns { number } The audio timestamp.
8224     * @syscap SystemCapability.Multimedia.Audio.Capturer
8225     * @crossplatform
8226     * @since 12
8227     */
8228    getAudioTimeSync(): number;
8229
8230    /**
8231     * Stops capturing. This method uses an asynchronous callback to return the result.
8232     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8233     * @syscap SystemCapability.Multimedia.Audio.Capturer
8234     * @since 8
8235     */
8236    /**
8237     * Stops capturing. This method uses an asynchronous callback to return the result.
8238     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8239     * @syscap SystemCapability.Multimedia.Audio.Capturer
8240     * @crossplatform
8241     * @since 12
8242     */
8243    stop(callback: AsyncCallback<void>): void;
8244    /**
8245     * Stops capturing. This method uses a promise to return the result.
8246     * @returns { Promise<void> } Promise used to return the result.
8247     * @syscap SystemCapability.Multimedia.Audio.Capturer
8248     * @since 8
8249     */
8250    /**
8251     * Stops capturing. This method uses a promise to return the result.
8252     * @returns { Promise<void> } Promise used to return the result.
8253     * @syscap SystemCapability.Multimedia.Audio.Capturer
8254     * @crossplatform
8255     * @since 12
8256     */
8257    stop(): Promise<void>;
8258
8259    /**
8260     * Releases the capturer. This method uses an asynchronous callback to return the result.
8261     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8262     * @syscap SystemCapability.Multimedia.Audio.Capturer
8263     * @since 8
8264     */
8265    /**
8266     * Releases the capturer. This method uses an asynchronous callback to return the result.
8267     * @param { AsyncCallback<void> } callback - Callback used to return the result.
8268     * @syscap SystemCapability.Multimedia.Audio.Capturer
8269     * @crossplatform
8270     * @since 12
8271     */
8272    release(callback: AsyncCallback<void>): void;
8273    /**
8274     * Releases the capturer. This method uses a promise to return the result.
8275     * @returns { Promise<void> } - Promise used to return the result.
8276     * @syscap SystemCapability.Multimedia.Audio.Capturer
8277     * @since 8
8278     */
8279    /**
8280     * Releases the capturer. This method uses a promise to return the result.
8281     * @returns { Promise<void> } - Promise used to return the result.
8282     * @syscap SystemCapability.Multimedia.Audio.Capturer
8283     * @crossplatform
8284     * @since 12
8285     */
8286    release(): Promise<void>;
8287
8288    /**
8289     * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses an asynchronous callback to
8290     * return the result.
8291     * @param { AsyncCallback<number> } callback - Callback used to return the buffer size.
8292     * @syscap SystemCapability.Multimedia.Audio.Capturer
8293     * @since 8
8294     */
8295    /**
8296     * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses an asynchronous callback to
8297     * return the result.
8298     * @param { AsyncCallback<number> } callback - Callback used to return the buffer size.
8299     * @syscap SystemCapability.Multimedia.Audio.Capturer
8300     * @crossplatform
8301     * @since 12
8302     */
8303    getBufferSize(callback: AsyncCallback<number>): void;
8304    /**
8305     * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses a promise to return the result.
8306     * @returns { Promise<number> } Promise used to return the buffer size.
8307     * @syscap SystemCapability.Multimedia.Audio.Capturer
8308     * @since 8
8309     */
8310    /**
8311     * Obtains a reasonable minimum buffer size in bytes for capturing. This method uses a promise to return the result.
8312     * @returns { Promise<number> } Promise used to return the buffer size.
8313     * @syscap SystemCapability.Multimedia.Audio.Capturer
8314     * @crossplatform
8315     * @since 12
8316     */
8317    getBufferSize(): Promise<number>;
8318    /**
8319     * Obtains a reasonable minimum buffer size in bytes for capturing.
8320     * @returns { number } Promise used to return the buffer size.
8321     * @syscap SystemCapability.Multimedia.Audio.Capturer
8322     * @since 10
8323     */
8324    /**
8325     * Obtains a reasonable minimum buffer size in bytes for capturing.
8326     * @returns { number } Promise used to return the buffer size.
8327     * @syscap SystemCapability.Multimedia.Audio.Capturer
8328     * @crossplatform
8329     * @since 12
8330     */
8331    getBufferSizeSync(): number;
8332
8333    /**
8334     * Gets the input device or devices for this stream.
8335     * @returns { AudioDeviceDescriptors } Descriptors of input devices.
8336     * @syscap SystemCapability.Multimedia.Audio.Device
8337     * @since 11
8338     */
8339    /**
8340     * Gets the input device or devices for this stream.
8341     * @returns { AudioDeviceDescriptors } Descriptors of input devices.
8342     * @syscap SystemCapability.Multimedia.Audio.Device
8343     * @crossplatform
8344     * @since 12
8345     */
8346    getCurrentInputDevices(): AudioDeviceDescriptors;
8347
8348    /**
8349     * Gets full capturer info for this stream.
8350     * @returns { AudioCapturerChangeInfo } Full capture info.
8351     * @syscap SystemCapability.Multimedia.Audio.Device
8352     * @since 11
8353     */
8354    /**
8355     * Gets full capturer info for this stream.
8356     * @returns { AudioCapturerChangeInfo } Full capture info.
8357     * @syscap SystemCapability.Multimedia.Audio.Device
8358     * @crossplatform
8359     * @since 12
8360     */
8361    getCurrentAudioCapturerChangeInfo(): AudioCapturerChangeInfo;
8362
8363    /**
8364     * Gets overflow count.
8365     * @returns { Promise<number> } - Promise used to return the result.
8366     * @syscap SystemCapability.Multimedia.Audio.Capturer
8367     * @since 12
8368     */
8369    getOverflowCount(): Promise<number>
8370
8371    /**
8372     * Gets overflow count.
8373     * @returns { number } Overflow count number.
8374     * @syscap SystemCapability.Multimedia.Audio.Capturer
8375     * @since 12
8376     */
8377    getOverflowCountSync(): number;
8378
8379    /**
8380     * Subscribes to mark reached events. When the number of frames captured reaches the value of the frame parameter,
8381     * the callback is invoked.
8382     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
8383     * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0.
8384     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
8385     * @syscap SystemCapability.Multimedia.Audio.Capturer
8386     * @since 8
8387     */
8388    /**
8389     * Subscribes to mark reached events. When the number of frames captured reaches the value of the frame parameter,
8390     * the callback is invoked.
8391     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
8392     * @param { number } frame - Number of frames to trigger the event. The value must be greater than 0.
8393     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
8394     * @syscap SystemCapability.Multimedia.Audio.Capturer
8395     * @crossplatform
8396     * @since 12
8397     */
8398    on(type: 'markReach', frame: number, callback: Callback<number>): void;
8399    /**
8400     * Unsubscribes from the mark reached events.
8401     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
8402     * @syscap SystemCapability.Multimedia.Audio.Capturer
8403     * @since 8
8404     */
8405    /**
8406     * Unsubscribes from the mark reached events.
8407     * @param { 'markReach' } type - Type of the event to listen for. Only the markReach event is supported.
8408     * @syscap SystemCapability.Multimedia.Audio.Capturer
8409     * @crossplatform
8410     * @since 12
8411     */
8412    off(type: 'markReach'): void;
8413
8414    /**
8415     * Subscribes to period reached events. When the period of frame capturing reaches the value of frame parameter,
8416     * the callback is invoked.
8417     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
8418     * @param { number } frame - Period during which frame capturing is listened. The value must be greater than 0.
8419     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
8420     * @syscap SystemCapability.Multimedia.Audio.Capturer
8421     * @since 8
8422     */
8423    /**
8424     * Subscribes to period reached events. When the period of frame capturing reaches the value of frame parameter,
8425     * the callback is invoked.
8426     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
8427     * @param { number } frame - Period during which frame capturing is listened. The value must be greater than 0.
8428     * @param { Callback<number> } callback - Callback invoked when the event is triggered.
8429     * @syscap SystemCapability.Multimedia.Audio.Capturer
8430     * @crossplatform
8431     * @since 12
8432     */
8433    on(type: 'periodReach', frame: number, callback: Callback<number>): void;
8434    /**
8435     * Unsubscribes from period reached events.
8436     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
8437     * @syscap SystemCapability.Multimedia.Audio.Capturer
8438     * @since 8
8439     */
8440    /**
8441     * Unsubscribes from period reached events.
8442     * @param { 'periodReach' } type - Type of the event to listen for. Only the periodReach event is supported.
8443     * @syscap SystemCapability.Multimedia.Audio.Capturer
8444     * @crossplatform
8445     * @since 12
8446     */
8447    off(type: 'periodReach'): void;
8448
8449    /**
8450     * Subscribes audio state change event callback.
8451     * @param { 'stateChange' } type - Type of the event to listen for. Only the stateChange event is supported.
8452     * @param { Callback<AudioState> } callback - Callback used to listen for the audio state change event.
8453     * @syscap SystemCapability.Multimedia.Audio.Capturer
8454     * @since 8
8455     */
8456    /**
8457     * Subscribes audio state change event callback.
8458     * @param { 'stateChange' } type - Type of the event to listen for. Only the stateChange event is supported.
8459     * @param { Callback<AudioState> } callback - Callback used to listen for the audio state change event.
8460     * @syscap SystemCapability.Multimedia.Audio.Capturer
8461     * @crossplatform
8462     * @since 12
8463     */
8464    on(type: 'stateChange', callback: Callback<AudioState>): void;
8465
8466    /**
8467     * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is
8468     * triggered when audio recording is interrupted.
8469     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
8470     * @param { Callback<InterruptEvent> } callback - Callback used to listen for interrupt callback.
8471     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8472     *                                 1.Mandatory parameters are left unspecified;
8473     *                                 2.Incorrect parameter types.
8474     * @throws { BusinessError } 6800101 - Parameter verification failed.
8475     * @syscap SystemCapability.Multimedia.Audio.Interrupt
8476     * @since 10
8477     */
8478    /**
8479     * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is
8480     * triggered when audio recording is interrupted.
8481     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
8482     * @param { Callback<InterruptEvent> } callback - Callback used to listen for interrupt callback.
8483     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8484     *                                 1.Mandatory parameters are left unspecified;
8485     *                                 2.Incorrect parameter types.
8486     * @throws { BusinessError } 6800101 - Parameter verification failed.
8487     * @syscap SystemCapability.Multimedia.Audio.Interrupt
8488     * @crossplatform
8489     * @since 12
8490     */
8491    on(type: 'audioInterrupt', callback: Callback<InterruptEvent>): void;
8492
8493    /**
8494     * UnSubscribes to audio interrupt events.
8495     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
8496     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8497     *                                 1.Mandatory parameters are left unspecified;
8498     *                                 2.Incorrect parameter types.
8499     * @throws { BusinessError } 6800101 - Parameter verification failed.
8500     * @syscap SystemCapability.Multimedia.Audio.Interrupt
8501     * @since 10
8502     */
8503    /**
8504     * UnSubscribes to audio interrupt events.
8505     * @param { 'audioInterrupt' } type - Type of the event to listen for. Only the audioInterrupt event is supported.
8506     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8507     *                                 1.Mandatory parameters are left unspecified;
8508     *                                 2.Incorrect parameter types.
8509     * @throws { BusinessError } 6800101 - Parameter verification failed.
8510     * @syscap SystemCapability.Multimedia.Audio.Interrupt
8511     * @crossplatform
8512     * @since 12
8513     */
8514    off(type: 'audioInterrupt'): void;
8515
8516    /**
8517     * Subscribes input device change event callback.
8518     * The event is triggered when input device change for this stream.
8519     * @param { 'inputDeviceChange' } type - Type of the event to listen for.
8520     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to listen device change event.
8521     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8522     *                                 1.Mandatory parameters are left unspecified;
8523     *                                 2.Incorrect parameter types.
8524     * @throws { BusinessError } 6800101 - Parameter verification failed.
8525     * @syscap SystemCapability.Multimedia.Audio.Device
8526     * @since 11
8527     */
8528    /**
8529     * Subscribes input device change event callback.
8530     * The event is triggered when input device change for this stream.
8531     * @param { 'inputDeviceChange' } type - Type of the event to listen for.
8532     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used to listen device change event.
8533     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8534     *                                 1.Mandatory parameters are left unspecified;
8535     *                                 2.Incorrect parameter types.
8536     * @throws { BusinessError } 6800101 - Parameter verification failed.
8537     * @syscap SystemCapability.Multimedia.Audio.Device
8538     * @crossplatform
8539     * @since 12
8540     */
8541    on(type: 'inputDeviceChange', callback: Callback<AudioDeviceDescriptors>): void;
8542    /**
8543     * Unsubscribes input device change event callback.
8544     * @param { 'inputDeviceChange' } type - Type of the event to listen for.
8545     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used in subscribe.
8546     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8547     *                                 1.Mandatory parameters are left unspecified;
8548     *                                 2.Incorrect parameter types.
8549     * @throws { BusinessError } 6800101 - Parameter verification failed.
8550     * @syscap SystemCapability.Multimedia.Audio.Device
8551     * @since 11
8552     */
8553    /**
8554     * Unsubscribes input device change event callback.
8555     * @param { 'inputDeviceChange' } type - Type of the event to listen for.
8556     * @param { Callback<AudioDeviceDescriptors> } callback - Callback used in subscribe.
8557     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8558     *                                 1.Mandatory parameters are left unspecified;
8559     *                                 2.Incorrect parameter types.
8560     * @throws { BusinessError } 6800101 - Parameter verification failed.
8561     * @syscap SystemCapability.Multimedia.Audio.Device
8562     * @crossplatform
8563     * @since 12
8564     */
8565    off(type: 'inputDeviceChange', callback?: Callback<AudioDeviceDescriptors>): void;
8566
8567    /**
8568     * Subscribes audio capturer info change event callback.
8569     * The event is triggered when input device change for this stream.
8570     * @param { 'audioCapturerChange' } type - Type of the event to listen for.
8571     * @param { Callback<AudioCapturerChangeInfo> } callback - Callback used to listen device change event.
8572     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8573     *                                 1.Mandatory parameters are left unspecified;
8574     *                                 2.Incorrect parameter types.
8575     * @throws { BusinessError } 6800101 - Parameter verification failed.
8576     * @syscap SystemCapability.Multimedia.Audio.Capturer
8577     * @since 11
8578     */
8579    /**
8580     * Subscribes audio capturer info change event callback.
8581     * The event is triggered when input device change for this stream.
8582     * @param { 'audioCapturerChange' } type - Type of the event to listen for.
8583     * @param { Callback<AudioCapturerChangeInfo> } callback - Callback used to listen device change event.
8584     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8585     *                                 1.Mandatory parameters are left unspecified;
8586     *                                 2.Incorrect parameter types.
8587     * @throws { BusinessError } 6800101 - Parameter verification failed.
8588     * @syscap SystemCapability.Multimedia.Audio.Capturer
8589     * @crossplatform
8590     * @since 12
8591     */
8592    on(type: 'audioCapturerChange', callback: Callback<AudioCapturerChangeInfo>): void;
8593    /**
8594     * Unsubscribes audio capturer info change event callback.
8595     * @param { 'audioCapturerChange' } type - Type of the event to listen for.
8596     * @param { Callback<AudioCapturerChangeInfo> } callback - Callback used in subscribe.
8597     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8598     *                                 1.Mandatory parameters are left unspecified;
8599     *                                 2.Incorrect parameter types.
8600     * @throws { BusinessError } 6800101 - Parameter verification failed.
8601     * @syscap SystemCapability.Multimedia.Audio.Capturer
8602     * @since 11
8603     */
8604    /**
8605     * Unsubscribes audio capturer info change event callback.
8606     * @param { 'audioCapturerChange' } type - Type of the event to listen for.
8607     * @param { Callback<AudioCapturerChangeInfo> } callback - Callback used in subscribe.
8608     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8609     *                                 1.Mandatory parameters are left unspecified;
8610     *                                 2.Incorrect parameter types.
8611     * @throws { BusinessError } 6800101 - Parameter verification failed.
8612     * @syscap SystemCapability.Multimedia.Audio.Capturer
8613     * @crossplatform
8614     * @since 12
8615     */
8616    off(type: 'audioCapturerChange', callback?: Callback<AudioCapturerChangeInfo>): void;
8617
8618    /**
8619     * Subscribes audio data callback.
8620     * The event is triggered when audio buffer is available for reading more data.
8621     * @param { 'readData' } type - Type of the event to listen for.
8622     * @param { Callback<ArrayBuffer> } callback - Callback with the buffer to read.
8623     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8624     *                                 1.Mandatory parameters are left unspecified;
8625     *                                 2.Incorrect parameter types.
8626     * @throws { BusinessError } 6800101 - Parameter verification failed.
8627     * @syscap SystemCapability.Multimedia.Audio.Capturer
8628     * @since 11
8629     */
8630    /**
8631     * Subscribes audio data callback.
8632     * The event is triggered when audio buffer is available for reading more data.
8633     * @param { 'readData' } type - Type of the event to listen for.
8634     * @param { Callback<ArrayBuffer> } callback - Callback with the buffer to read.
8635     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8636     *                                 1.Mandatory parameters are left unspecified;
8637     *                                 2.Incorrect parameter types.
8638     * @throws { BusinessError } 6800101 - Parameter verification failed.
8639     * @syscap SystemCapability.Multimedia.Audio.Capturer
8640     * @crossplatform
8641     * @since 12
8642     */
8643    on(type: 'readData', callback: Callback<ArrayBuffer>): void;
8644
8645    /**
8646     * Unsubscribes audio data callback.
8647     * @param { 'readData' } type - Type of the event to listen for.
8648     * @param { Callback<ArrayBuffer> } callback - Callback used in subscribe.
8649     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8650     *                                 1.Mandatory parameters are left unspecified;
8651     *                                 2.Incorrect parameter types.
8652     * @throws { BusinessError } 6800101 - Parameter verification failed.
8653     * @syscap SystemCapability.Multimedia.Audio.Capturer
8654     * @since 11
8655     */
8656    /**
8657     * Unsubscribes audio data callback.
8658     * @param { 'readData' } type - Type of the event to listen for.
8659     * @param { Callback<ArrayBuffer> } callback - Callback used in subscribe.
8660     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8661     *                                 1.Mandatory parameters are left unspecified;
8662     *                                 2.Incorrect parameter types.
8663     * @throws { BusinessError } 6800101 - Parameter verification failed.
8664     * @syscap SystemCapability.Multimedia.Audio.Capturer
8665     * @crossplatform
8666     * @since 12
8667     */
8668    off(type: 'readData', callback?: Callback<ArrayBuffer>): void;
8669  }
8670
8671  /**
8672   * ASR noise suppression mode.
8673   * @enum { number }
8674   * @syscap SystemCapability.Multimedia.Audio.Capturer
8675   * @systemapi
8676   * @since 12
8677   */
8678  enum AsrNoiseSuppressionMode {
8679    /**
8680     * Bypass noise suppression.
8681     * @syscap SystemCapability.Multimedia.Audio.Capturer
8682     * @systemapi
8683     * @since 12
8684     */
8685    BYPASS = 0,
8686    /**
8687     * Standard noise suppression.
8688     * @syscap SystemCapability.Multimedia.Audio.Capturer
8689     * @systemapi
8690     * @since 12
8691     */
8692    STANDARD = 1,
8693    /**
8694     * Near field noise suppression.
8695     * @syscap SystemCapability.Multimedia.Audio.Capturer
8696     * @systemapi
8697     * @since 12
8698     */
8699    NEAR_FIELD = 2,
8700    /**
8701     * Far field noise suppression.
8702     * @syscap SystemCapability.Multimedia.Audio.Capturer
8703     * @systemapi
8704     * @since 12
8705     */
8706    FAR_FIELD = 3,
8707  }
8708
8709  /**
8710   * ASR AEC mode.
8711   * @enum { number }
8712   * @syscap SystemCapability.Multimedia.Audio.Capturer
8713   * @systemapi
8714   * @since 12
8715   */
8716  enum AsrAecMode {
8717    /**
8718     * Bypass AEC.
8719     * @syscap SystemCapability.Multimedia.Audio.Capturer
8720     * @systemapi
8721     * @since 12
8722     */
8723    BYPASS = 0,
8724    /**
8725     * Using standard AEC.
8726     * @syscap SystemCapability.Multimedia.Audio.Capturer
8727     * @systemapi
8728     * @since 12
8729     */
8730    STANDARD = 1,
8731  }
8732
8733  /**
8734   * ASR voice control mode.
8735   * @enum { number }
8736   * @syscap SystemCapability.Multimedia.Audio.Capturer
8737   * @systemapi
8738   * @since 12
8739   */
8740  enum AsrVoiceControlMode {
8741    /**
8742     * Send output stream to TX.
8743     * @syscap SystemCapability.Multimedia.Audio.Capturer
8744     * @systemapi
8745     * @since 12
8746     */
8747    AUDIO_2_VOICE_TX = 0,
8748    /**
8749     * Send both output stream and MIC input to TX.
8750     * @syscap SystemCapability.Multimedia.Audio.Capturer
8751     * @systemapi
8752     * @since 12
8753     */
8754    AUDIO_MIX_2_VOICE_TX = 1,
8755    /**
8756     * Based on the AUDIO_2_VOICE_TX, Send output stream to voice call record.
8757     * @syscap SystemCapability.Multimedia.Audio.Capturer
8758     * @systemapi
8759     * @since 12
8760     */
8761    AUDIO_2_VOICE_TX_EX = 2,
8762    /**
8763     * Based on the AUDIO_MIX_2_VOICE_TX, Send output stream to voice call record.
8764     * @syscap SystemCapability.Multimedia.Audio.Capturer
8765     * @systemapi
8766     * @since 12
8767     */
8768    AUDIO_MIX_2_VOICE_TX_EX = 3,
8769  }
8770
8771  /**
8772   * ASR voice mute mode.
8773   * @enum { number }
8774   * @syscap SystemCapability.Multimedia.Audio.Capturer
8775   * @systemapi
8776   * @since 12
8777   */
8778  enum AsrVoiceMuteMode {
8779    /**
8780     * Mute the local output stream.
8781     * @syscap SystemCapability.Multimedia.Audio.Capturer
8782     * @systemapi
8783     * @since 12
8784     */
8785    OUTPUT_MUTE = 0,
8786    /**
8787     * Mute the local MIC input stream.
8788     * @syscap SystemCapability.Multimedia.Audio.Capturer
8789     * @systemapi
8790     * @since 12
8791     */
8792    INPUT_MUTE = 1,
8793    /**
8794     * Send tts output stream to TX and mute the local output stream.
8795     * @syscap SystemCapability.Multimedia.Audio.Capturer
8796     * @systemapi
8797     * @since 12
8798     */
8799    TTS_MUTE = 2,
8800    /**
8801     * Mute the voice call stream.
8802     * @syscap SystemCapability.Multimedia.Audio.Capturer
8803     * @systemapi
8804       * @since 12
8805       */
8806    CALL_MUTE = 3,
8807    /**
8808     * Based on the OUTPUT_MUTE, send output stream to voice call record.
8809     * @syscap SystemCapability.Multimedia.Audio.Capturer
8810     * @systemapi
8811     * @since 12
8812     */
8813    OUTPUT_MUTE_EX = 4,
8814  }
8815
8816  /**
8817   * ASR whisper detection mode.
8818   * @enum { number }
8819   * @syscap SystemCapability.Multimedia.Audio.Capturer
8820   * @systemapi
8821   * @since 12
8822   */
8823  enum AsrWhisperDetectionMode {
8824    /**
8825     * No operation.
8826     * @syscap SystemCapability.Multimedia.Audio.Capturer
8827     * @systemapi
8828     * @since 12
8829     */
8830    BYPASS = 0,
8831    /**
8832     * Use standard whisper detection model.
8833     * @syscap SystemCapability.Multimedia.Audio.Capturer
8834     * @systemapi
8835     * @since 12
8836     */
8837    STANDARD = 1,
8838  }
8839
8840  /**
8841   * ASR processing controller.
8842   * @typedef AsrProcessingController
8843   * @syscap SystemCapability.Multimedia.Audio.Capturer
8844   * @systemapi
8845   * @since 12
8846   */
8847  interface AsrProcessingController {
8848    /**
8849     * Set ASR AEC mode.
8850     * @param { AsrAecMode } mode - ASR AEC Mode.
8851     * @returns { boolean } Indicates whether the mode has been successfully set.
8852     * @throws { BusinessError } 202 - Caller is not a system application.
8853     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8854     *                                 1.Mandatory parameters are left unspecified;
8855     *                                 2.Incorrect parameter types.
8856     * @throws { BusinessError } 6800101 - Parameter verification failed.
8857     * @throws { BusinessError } 6800104 - Operation not allowed.
8858     * @syscap SystemCapability.Multimedia.Audio.Capturer
8859     * @systemapi
8860     * @since 12
8861     */
8862    setAsrAecMode(mode: AsrAecMode): boolean;
8863
8864    /**
8865     * Get ASR AEC mode.
8866     * @returns { AsrAecMode } ASR AEC Mode.
8867     * @throws { BusinessError } 202 - Caller is not a system application.
8868     * @throws { BusinessError } 6800104 - Operation not allowed.
8869     * @syscap SystemCapability.Multimedia.Audio.Capturer
8870     * @systemapi
8871     * @since 12
8872     */
8873    getAsrAecMode(): AsrAecMode;
8874
8875    /**
8876     * Set ASR noise suppression mode.
8877     * @param { AsrNoiseSuppressionMode } mode - ASR noise suppression mode.
8878     * @returns { boolean } Indicates whether the mode has been successfully set.
8879     * @throws { BusinessError } 202 - Caller is not a system application.
8880     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8881     *                                 1.Mandatory parameters are left unspecified;
8882     *                                 2.Incorrect parameter types.
8883     * @throws { BusinessError } 6800101 - Parameter verification failed.
8884     * @throws { BusinessError } 6800104 - Operation not allowed.
8885     * @syscap SystemCapability.Multimedia.Audio.Capturer
8886     * @systemapi
8887     * @since 12
8888     */
8889    setAsrNoiseSuppressionMode(mode: AsrNoiseSuppressionMode): boolean;
8890
8891    /**
8892     * Get ASR noise suppression mode.
8893     * @returns { AsrNoiseSuppressionMode } ASR noise suppression mode.
8894     * @throws { BusinessError } 202 - Caller is not a system application.
8895     * @throws { BusinessError } 6800104 - Operation not allowed.
8896     * @syscap SystemCapability.Multimedia.Audio.Capturer
8897     * @systemapi
8898     * @since 12
8899     */
8900    getAsrNoiseSuppressionMode(): AsrNoiseSuppressionMode;
8901
8902    /**
8903     * Query whether user is whispering.
8904     * @returns { boolean } whether user is whispering.
8905     * @throws { BusinessError } 202 - Caller is not a system application.
8906     * @throws { BusinessError } 6800104 - Operation not allowed.
8907     * @syscap SystemCapability.Multimedia.Audio.Capturer
8908     * @systemapi
8909     * @since 12
8910     */
8911    isWhispering(): boolean;
8912
8913    /**
8914     * Set ASR voice control mode.
8915     * @param { AsrVoiceControlMode } mode - ASR voice control mode.
8916     * @param { boolean } enable - Indicates whether to switch on/off this mode.
8917     * @returns { boolean } Indicates whether the mode has been successfully set.
8918     * @throws { BusinessError } 202 - Caller is not a system application.
8919     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8920     *                                 1.Mandatory parameters unspecified.
8921     *                                 2.Incorrect parameter types.
8922     * @throws { BusinessError } 6800101 - Parameter verification failed.
8923     * @throws { BusinessError } 6800104 - Operation not allowed.
8924     * @syscap SystemCapability.Multimedia.Audio.Capturer
8925     * @systemapi
8926     * @since 12
8927     */
8928    setAsrVoiceControlMode(mode: AsrVoiceControlMode, enable: boolean): boolean;
8929
8930    /**
8931     * Set ASR voice mute mode.
8932     * @param { AsrVoiceMuteMode } mode - ASR voice mute mode.
8933     * @param { boolean } enable - Indicates whether to switch on/off this mode.
8934     * @returns { boolean } Indicates whether the mode has been successfully set.
8935     * @throws { BusinessError } 202 - Caller is not a system application.
8936     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8937     *                                 1.Mandatory parameters unspecified.
8938     *                                 2.Incorrect parameter types.
8939     * @throws { BusinessError } 6800101 - Parameter verification failed.
8940     * @throws { BusinessError } 6800104 - Operation not allowed.
8941     * @syscap SystemCapability.Multimedia.Audio.Capturer
8942     * @systemapi
8943     * @since 12
8944     */
8945    setAsrVoiceMuteMode(mode: AsrVoiceMuteMode, enable: boolean): boolean;
8946
8947    /**
8948     * Set ASR whisper detection mode.
8949     * @param { AsrWhisperDetectionMode } mode - ASR whisper detection mode.
8950     * @returns { boolean } Indicates whether the mode has been successfully set.
8951     * @throws { BusinessError } 202 - Caller is not a system application.
8952     * @throws { BusinessError } 401 - Parameter error. Possible causes:
8953     *                                 1.Mandatory parameters unspecified.
8954     *                                 2.Incorrect parameter types.
8955     * @throws { BusinessError } 6800101 - Parameter verification failed.
8956     * @throws { BusinessError } 6800104 - Operation not allowed.
8957     * @syscap SystemCapability.Multimedia.Audio.Capturer
8958     * @systemapi
8959     * @since 12
8960     */
8961    setAsrWhisperDetectionMode(mode: AsrWhisperDetectionMode): boolean;
8962
8963    /**
8964     * Get ASR whisper detection mode.
8965     * @returns { AsrWhisperDetectionMode } ASR whisper detection mode.
8966     * @throws { BusinessError } 202 - Caller is not a system application.
8967     * @throws { BusinessError } 6800104 - Operation not allowed.
8968     * @syscap SystemCapability.Multimedia.Audio.Capturer
8969     * @systemapi
8970     * @since 12
8971     */
8972    getAsrWhisperDetectionMode(): AsrWhisperDetectionMode;
8973  }
8974
8975  /**
8976   * Create ASR processing controller on one audio capturer.
8977   * @param { AudioCapturer } audioCapturer - The audio capturer whose ASR processing will be controlled. The source
8978   * type of this capturer must be {@link SourceType#SOURCE_TYPE_VOICE_RECOGNITION}.
8979   * @returns { AsrProcessingController } ASR Processing Controller.
8980   * @throws { BusinessError } 202 - Caller is not a system application.
8981   * @throws { BusinessError } 401 - Parameter error. Possible causes:
8982   *                                 1.Mandatory parameters are left unspecified;
8983   *                                 2.Incorrect parameter types.
8984   * @throws { BusinessError } 6800101 - Parameter verification failed.
8985   * @throws { BusinessError } 6800104 - Operation not allowed. e.g. the source type of the input audio capturer is not
8986   * {@link SourceType#SOURCE_TYPE_VOICE_RECOGNITION} or {@link SourceType#SOURCE_TYPE_WAKEUP}, or this audio capturer
8987   * is already released.
8988   * @syscap SystemCapability.Multimedia.Audio.Capturer
8989   * @systemapi
8990   * @since 12
8991   */
8992  function createAsrProcessingController(audioCapturer: AudioCapturer): AsrProcessingController;
8993
8994  /**
8995   * Enumerates tone types for player.
8996   * @enum { number }
8997   * @syscap SystemCapability.Multimedia.Audio.Tone
8998   * @systemapi
8999   * @since 9
9000   */
9001  enum ToneType {
9002    /**
9003     * Dial tone for key 0.
9004     * @syscap SystemCapability.Multimedia.Audio.Tone
9005     * @systemapi
9006     * @since 9
9007     */
9008    TONE_TYPE_DIAL_0 = 0,
9009    /**
9010     * Dial tone for key 1.
9011     * @syscap SystemCapability.Multimedia.Audio.Tone
9012     * @systemapi
9013     * @since 9
9014     */
9015    TONE_TYPE_DIAL_1 = 1,
9016    /**
9017     * Dial tone for key 2.
9018     * @syscap SystemCapability.Multimedia.Audio.Tone
9019     * @systemapi
9020     * @since 9
9021     */
9022    TONE_TYPE_DIAL_2 = 2,
9023    /**
9024     * Dial tone for key 3.
9025     * @syscap SystemCapability.Multimedia.Audio.Tone
9026     * @systemapi
9027     * @since 9
9028     */
9029    TONE_TYPE_DIAL_3 = 3,
9030    /**
9031     * Dial tone for key 4.
9032     * @syscap SystemCapability.Multimedia.Audio.Tone
9033     * @systemapi
9034     * @since 9
9035     */
9036    TONE_TYPE_DIAL_4 = 4,
9037    /**
9038     * Dial tone for key 5.
9039     * @syscap SystemCapability.Multimedia.Audio.Tone
9040     * @systemapi
9041     * @since 9
9042     */
9043    TONE_TYPE_DIAL_5 = 5,
9044    /**
9045     * Dial tone for key 6.
9046     * @syscap SystemCapability.Multimedia.Audio.Tone
9047     * @systemapi
9048     * @since 9
9049     */
9050    TONE_TYPE_DIAL_6 = 6,
9051    /**
9052     * Dial tone for key 7.
9053     * @syscap SystemCapability.Multimedia.Audio.Tone
9054     * @systemapi
9055     * @since 9
9056     */
9057    TONE_TYPE_DIAL_7 = 7,
9058    /**
9059     * Dial tone for key 8.
9060     * @syscap SystemCapability.Multimedia.Audio.Tone
9061     * @systemapi
9062     * @since 9
9063     */
9064    TONE_TYPE_DIAL_8 = 8,
9065    /**
9066     * Dial tone for key 9.
9067     * @syscap SystemCapability.Multimedia.Audio.Tone
9068     * @systemapi
9069     * @since 9
9070     */
9071    TONE_TYPE_DIAL_9 = 9,
9072    /**
9073     * Dial tone for key *.
9074     * @syscap SystemCapability.Multimedia.Audio.Tone
9075     * @systemapi
9076     * @since 9
9077     */
9078    TONE_TYPE_DIAL_S = 10,
9079    /**
9080     * Dial tone for key #.
9081     * @syscap SystemCapability.Multimedia.Audio.Tone
9082     * @systemapi
9083     * @since 9
9084     */
9085    TONE_TYPE_DIAL_P = 11,
9086    /**
9087     * Dial tone for key A.
9088     * @syscap SystemCapability.Multimedia.Audio.Tone
9089     * @systemapi
9090     * @since 9
9091     */
9092    TONE_TYPE_DIAL_A = 12,
9093    /**
9094     * Dial tone for key B.
9095     * @syscap SystemCapability.Multimedia.Audio.Tone
9096     * @systemapi
9097     * @since 9
9098     */
9099    TONE_TYPE_DIAL_B = 13,
9100    /**
9101     * Dial tone for key C.
9102     * @syscap SystemCapability.Multimedia.Audio.Tone
9103     * @systemapi
9104     * @since 9
9105     */
9106    TONE_TYPE_DIAL_C = 14,
9107    /**
9108     * Dial tone for key D.
9109     * @syscap SystemCapability.Multimedia.Audio.Tone
9110     * @systemapi
9111     * @since 9
9112     */
9113    TONE_TYPE_DIAL_D = 15,
9114    /**
9115     * Supervisory tone for dial.
9116     * @syscap SystemCapability.Multimedia.Audio.Tone
9117     * @systemapi
9118     * @since 9
9119     */
9120    TONE_TYPE_COMMON_SUPERVISORY_DIAL = 100,
9121    /**
9122     * Supervisory tone for busy.
9123     * @syscap SystemCapability.Multimedia.Audio.Tone
9124     * @systemapi
9125     * @since 9
9126     */
9127    TONE_TYPE_COMMON_SUPERVISORY_BUSY = 101,
9128    /**
9129     * Supervisory tone for dial.
9130     * @syscap SystemCapability.Multimedia.Audio.Tone
9131     * @systemapi
9132     * @since 9
9133     */
9134    TONE_TYPE_COMMON_SUPERVISORY_CONGESTION = 102,
9135    /**
9136     * Supervisory tone for radio path acknowledgment.
9137     * @syscap SystemCapability.Multimedia.Audio.Tone
9138     * @systemapi
9139     * @since 9
9140     */
9141    TONE_TYPE_COMMON_SUPERVISORY_RADIO_ACK = 103,
9142    /**
9143     * Supervisory tone for radio path not available.
9144     * @syscap SystemCapability.Multimedia.Audio.Tone
9145     * @systemapi
9146     * @since 9
9147     */
9148    TONE_TYPE_COMMON_SUPERVISORY_RADIO_NOT_AVAILABLE = 104,
9149    /**
9150     * Supervisory tone for call waiting.
9151     * @syscap SystemCapability.Multimedia.Audio.Tone
9152     * @systemapi
9153     * @since 9
9154     */
9155    TONE_TYPE_COMMON_SUPERVISORY_CALL_WAITING = 106,
9156    /**
9157     * Supervisory tone for ringtone.
9158     * @syscap SystemCapability.Multimedia.Audio.Tone
9159     * @systemapi
9160     * @since 9
9161     */
9162    TONE_TYPE_COMMON_SUPERVISORY_RINGTONE = 107,
9163    /**
9164     * Proprietary tone for beep.
9165     * @syscap SystemCapability.Multimedia.Audio.Tone
9166     * @systemapi
9167     * @since 9
9168     */
9169    TONE_TYPE_COMMON_PROPRIETARY_BEEP = 200,
9170    /**
9171     * Proprietary tone for positive acknowledgment.
9172     * @syscap SystemCapability.Multimedia.Audio.Tone
9173     * @systemapi
9174     * @since 9
9175     */
9176    TONE_TYPE_COMMON_PROPRIETARY_ACK = 201,
9177    /**
9178     * Proprietary tone for prompt.
9179     * @syscap SystemCapability.Multimedia.Audio.Tone
9180     * @systemapi
9181     * @since 9
9182     */
9183    TONE_TYPE_COMMON_PROPRIETARY_PROMPT = 203,
9184    /**
9185     * Proprietary tone for double beep.
9186     * @syscap SystemCapability.Multimedia.Audio.Tone
9187     * @systemapi
9188     * @since 9
9189     */
9190    TONE_TYPE_COMMON_PROPRIETARY_DOUBLE_BEEP = 204,
9191  }
9192
9193  /**
9194   * Provides APIs for tone playing.
9195   * @typedef TonePlayer
9196   * @syscap SystemCapability.Multimedia.Audio.Tone
9197   * @systemapi
9198   * @since 9
9199   */
9200  interface TonePlayer {
9201    /**
9202     * Loads tone. This method uses an asynchronous callback to return the result.
9203     * @param { ToneType } type - Tone type to play.
9204     * @param { AsyncCallback<void> } callback - Callback used to return the result.
9205     * @syscap SystemCapability.Multimedia.Audio.Tone
9206     * @systemapi
9207     * @since 9
9208     */
9209    load(type: ToneType, callback: AsyncCallback<void>): void;
9210    /**
9211     * Loads tone. This method uses a promise to return the result.
9212     * @param { ToneType } type - Tone type to play.
9213     * @returns { Promise<void> } Promise used to return the result.
9214     * @syscap SystemCapability.Multimedia.Audio.Tone
9215     * @systemapi
9216     * @since 9
9217     */
9218    load(type: ToneType): Promise<void>;
9219
9220    /**
9221     * Starts player. This method uses an asynchronous callback to return the result.
9222     * @param { AsyncCallback<void> } callback - Callback used to return the result.
9223     * @syscap SystemCapability.Multimedia.Audio.Tone
9224     * @systemapi
9225     * @since 9
9226     */
9227    start(callback: AsyncCallback<void>): void;
9228    /**
9229     * Starts player. This method uses a promise to return the result.
9230     * @returns { Promise<void> }Promise used to return the result.
9231     * @syscap SystemCapability.Multimedia.Audio.Tone
9232     * @systemapi
9233     * @since 9
9234     */
9235    start(): Promise<void>;
9236
9237    /**
9238     * Stops player. This method uses an asynchronous callback to return the result.
9239     * @param { AsyncCallback<void> } callback - Callback used to return the result.
9240     * @syscap SystemCapability.Multimedia.Audio.Tone
9241     * @systemapi
9242     * @since 9
9243     */
9244    stop(callback: AsyncCallback<void>): void;
9245    /**
9246     * Stops player. This method uses a promise to return the result.
9247     * @returns { Promise<void> } Promise used to return the result.
9248     * @syscap SystemCapability.Multimedia.Audio.Tone
9249     * @systemapi
9250     * @since 9
9251     */
9252    stop(): Promise<void>;
9253
9254    /**
9255     * Releases the player. This method uses an asynchronous callback to return the result.
9256     * @param { AsyncCallback<void> } callback - Callback used to return the result.
9257     * @syscap SystemCapability.Multimedia.Audio.Tone
9258     * @systemapi
9259     * @since 9
9260     */
9261    release(callback: AsyncCallback<void>): void;
9262    /**
9263     * Releases the player. This method uses a promise to return the result.
9264     * @returns { Promise<void> } Promise used to return the result.
9265     * @syscap SystemCapability.Multimedia.Audio.Tone
9266     * @systemapi
9267     * @since 9
9268     */
9269    release(): Promise<void>;
9270  }
9271
9272  /**
9273   * Array of AudioEffectMode, which is read-only.
9274   * @typedef { Array<Readonly<AudioEffectMode>> } AudioEffectInfoArray
9275   * @syscap SystemCapability.Multimedia.Audio.Renderer
9276   * @since 10
9277   */
9278  type AudioEffectInfoArray = Array<Readonly<AudioEffectMode>>;
9279
9280  /**
9281   * Describes an audio effect mode group.
9282   * @enum { number }
9283   * @syscap SystemCapability.Multimedia.Audio.Renderer
9284   * @since 10
9285   */
9286  /**
9287   * Describes an audio effect mode group.
9288   * @enum { number }
9289   * @syscap SystemCapability.Multimedia.Audio.Renderer
9290   * @atomicservice
9291   * @since 12
9292   */
9293  enum AudioEffectMode {
9294    /**
9295     * Audio Effect Mode effect none.
9296     * @syscap SystemCapability.Multimedia.Audio.Renderer
9297     * @since 10
9298     */
9299    /**
9300     * Audio Effect Mode effect none.
9301     * @syscap SystemCapability.Multimedia.Audio.Renderer
9302     * @atomicservice
9303     * @since 12
9304     */
9305    EFFECT_NONE = 0,
9306    /**
9307     * Audio Effect Mode effect default.
9308     * @syscap SystemCapability.Multimedia.Audio.Renderer
9309     * @since 10
9310     */
9311    /**
9312     * Audio Effect Mode effect default.
9313     * @syscap SystemCapability.Multimedia.Audio.Renderer
9314     * @atomicservice
9315     * @since 12
9316     */
9317    EFFECT_DEFAULT = 1,
9318  }
9319
9320  /**
9321   * Describes spatial device state.
9322   * @typedef AudioSpatialDeviceState
9323   * @syscap SystemCapability.Multimedia.Audio.Spatialization
9324   * @systemapi
9325   * @since 11
9326   */
9327  interface AudioSpatialDeviceState {
9328    /**
9329     * Spatial device address.
9330     * @type { string }
9331     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9332     * @systemapi
9333     * @since 11
9334     */
9335    address: string;
9336
9337    /**
9338     * Whether the spatial device supports spatial rendering.
9339     * @type { boolean }
9340     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9341     * @systemapi
9342     * @since 11
9343     */
9344    isSpatializationSupported: boolean;
9345
9346    /**
9347     * Whether the spatial device supports head tracking.
9348     * @type { boolean }
9349     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9350     * @systemapi
9351     * @since 11
9352     */
9353    isHeadTrackingSupported: boolean;
9354
9355    /**
9356     * Spatial device type.
9357     * @type { AudioSpatialDeviceType }
9358     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9359     * @systemapi
9360     * @since 11
9361     */
9362    spatialDeviceType: AudioSpatialDeviceType;
9363  }
9364
9365  /**
9366   * Describes a spatial device type group.
9367   * @enum { number }
9368   * @syscap SystemCapability.Multimedia.Audio.Spatialization
9369   * @systemapi
9370   * @since 11
9371   */
9372  enum AudioSpatialDeviceType {
9373    /**
9374     * Audio Spatial Device Type none.
9375     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9376     * @systemapi
9377     * @since 11
9378     */
9379    SPATIAL_DEVICE_TYPE_NONE = 0,
9380    /**
9381     * Audio Spatial Device Type in-ear headphone.
9382     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9383     * @systemapi
9384     * @since 11
9385     */
9386    SPATIAL_DEVICE_TYPE_IN_EAR_HEADPHONE = 1,
9387    /**
9388     * Audio Spatial Device Type half-in-ear headphone.
9389     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9390     * @systemapi
9391     * @since 11
9392     */
9393    SPATIAL_DEVICE_TYPE_HALF_IN_EAR_HEADPHONE = 2,
9394    /**
9395     * Audio Spatial Device Type over-ear headphone.
9396     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9397     * @systemapi
9398     * @since 11
9399     */
9400    SPATIAL_DEVICE_TYPE_OVER_EAR_HEADPHONE = 3,
9401    /**
9402     * Audio Spatial Device Type glasses.
9403     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9404     * @systemapi
9405     * @since 11
9406     */
9407    SPATIAL_DEVICE_TYPE_GLASSES = 4,
9408    /**
9409     * Audio Spatial Device Type others.
9410     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9411     * @systemapi
9412     * @since 11
9413     */
9414    SPATIAL_DEVICE_TYPE_OTHERS = 5,
9415  }
9416
9417  /**
9418   * Describes a spatialization scene type group.
9419   * @enum { number }
9420   * @syscap SystemCapability.Multimedia.Audio.Spatialization
9421   * @systemapi
9422   * @since 12
9423   */
9424  enum AudioSpatializationSceneType {
9425    /**
9426     * Audio Spatialization Scene Type Default.
9427     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9428     * @systemapi
9429     * @since 12
9430     */
9431    DEFAULT = 0,
9432    /**
9433     * Audio Spatialization Scene Type Music.
9434     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9435     * @systemapi
9436     * @since 12
9437     */
9438    MUSIC = 1,
9439    /**
9440     * Audio Spatialization Scene Type Movie.
9441     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9442     * @systemapi
9443     * @since 12
9444     */
9445    MOVIE = 2,
9446    /**
9447     * Audio Spatialization Scene Type Audio Book.
9448     * @syscap SystemCapability.Multimedia.Audio.Spatialization
9449     * @systemapi
9450     * @since 12
9451     */
9452    AUDIOBOOK = 3,
9453  }
9454
9455  /**
9456   * Audio AudioChannel Layout
9457   * A 64-bit integer indicates that the appearance and order of the speakers for recording or playback.
9458   * @enum { number }
9459   * @syscap SystemCapability.Multimedia.Audio.Core
9460   * @since 11
9461   */
9462  /**
9463   * Audio AudioChannel Layout
9464   * A 64-bit integer indicates that the appearance and order of the speakers for recording or playback.
9465   * @enum { number }
9466   * @syscap SystemCapability.Multimedia.Audio.Core
9467   * @crossplatform
9468   * @since 12
9469   */
9470  enum AudioChannelLayout {
9471    /**
9472     * Unknown Channel Layout
9473     * @syscap SystemCapability.Multimedia.Audio.Core
9474     * @since 11
9475     */
9476    /**
9477     * Unknown Channel Layout
9478     * @syscap SystemCapability.Multimedia.Audio.Core
9479     * @crossplatform
9480     * @since 12
9481     */
9482    CH_LAYOUT_UNKNOWN = 0x0,
9483    /**
9484     * Channel Layout For Mono, 1 channel in total
9485     * Speaker layout: front center(FC)
9486     * @syscap SystemCapability.Multimedia.Audio.Core
9487     * @since 11
9488     */
9489    /**
9490     * Channel Layout For Mono, 1 channel in total
9491     * Speaker layout: front center(FC)
9492     * @syscap SystemCapability.Multimedia.Audio.Core
9493     * @crossplatform
9494     * @since 12
9495     */
9496    CH_LAYOUT_MONO = 0x4,
9497    /**
9498     * Channel Layout For Stereo, 2 channels in total
9499     * Speaker layout: front left(FL), front right(FR)
9500     * @syscap SystemCapability.Multimedia.Audio.Core
9501     * @since 11
9502     */
9503    /**
9504     * Channel Layout For Stereo, 2 channels in total
9505     * Speaker layout: front left(FL), front right(FR)
9506     * @syscap SystemCapability.Multimedia.Audio.Core
9507     * @crossplatform
9508     * @since 12
9509     */
9510    CH_LAYOUT_STEREO = 0x3,
9511    /**
9512     * Channel Layout For Stereo-Downmix, 2 channels in total
9513     * Speaker layout: Stereo left, stereo right
9514     * @syscap SystemCapability.Multimedia.Audio.Core
9515     * @since 11
9516     */
9517    CH_LAYOUT_STEREO_DOWNMIX = 0x60000000,
9518    /**
9519     * Channel Layout For 2.1, 3 channels in total
9520     * Speaker layout: Stereo plus low-frequency effects(LFE)
9521     * @syscap SystemCapability.Multimedia.Audio.Core
9522     * @since 11
9523     */
9524    /**
9525     * Channel Layout For 2.1, 3 channels in total
9526     * Speaker layout: Stereo plus low-frequency effects(LFE)
9527     * @syscap SystemCapability.Multimedia.Audio.Core
9528     * @crossplatform
9529     * @since 12
9530     */
9531    CH_LAYOUT_2POINT1 = 0xB,
9532    /**
9533     * Channel Layout For 3.0, 3 channels in total
9534     * Speaker layout: Stereo plus back center(BC)
9535     * @syscap SystemCapability.Multimedia.Audio.Core
9536     * @since 11
9537     */
9538    /**
9539     * Channel Layout For 3.0, 3 channels in total
9540     * Speaker layout: Stereo plus back center(BC)
9541     * @syscap SystemCapability.Multimedia.Audio.Core
9542     * @crossplatform
9543     * @since 12
9544     */
9545    CH_LAYOUT_3POINT0 = 0x103,
9546    /**
9547     * Channel Layout For Surround, 3 channels in total
9548     * Speaker layout: Stereo plus FC
9549     * @syscap SystemCapability.Multimedia.Audio.Core
9550     * @since 11
9551     */
9552    /**
9553     * Channel Layout For Surround, 3 channels in total
9554     * Speaker layout: Stereo plus FC
9555     * @syscap SystemCapability.Multimedia.Audio.Core
9556     * @crossplatform
9557     * @since 12
9558     */
9559    CH_LAYOUT_SURROUND = 0x7,
9560    /**
9561     * Channel Layout For 3.1, 4 channels in total
9562     * Speaker layout: Surround plus LFE
9563     * @syscap SystemCapability.Multimedia.Audio.Core
9564     * @since 11
9565     */
9566    /**
9567     * Channel Layout For 3.1, 4 channels in total
9568     * Speaker layout: Surround plus LFE
9569     * @syscap SystemCapability.Multimedia.Audio.Core
9570     * @crossplatform
9571     * @since 12
9572     */
9573    CH_LAYOUT_3POINT1 = 0xF,
9574    /**
9575     * Channel Layout For 4.0, 4 channels in total
9576     * Speaker layout: Surround plus BC
9577     * @syscap SystemCapability.Multimedia.Audio.Core
9578     * @since 11
9579     */
9580    /**
9581     * Channel Layout For 4.0, 4 channels in total
9582     * Speaker layout: Surround plus BC
9583     * @syscap SystemCapability.Multimedia.Audio.Core
9584     * @crossplatform
9585     * @since 12
9586     */
9587    CH_LAYOUT_4POINT0 = 0x107,
9588    /**
9589     * Channel Layout For Quad, 4 channels in total
9590     * Speaker layout: Stereo plus left and right back speakers
9591     * @syscap SystemCapability.Multimedia.Audio.Core
9592     * @since 11
9593     */
9594    /**
9595     * Channel Layout For Quad, 4 channels in total
9596     * Speaker layout: Stereo plus left and right back speakers
9597     * @syscap SystemCapability.Multimedia.Audio.Core
9598     * @crossplatform
9599     * @since 12
9600     */
9601    CH_LAYOUT_QUAD = 0x33,
9602    /**
9603     * Channel Layout For Quad-Side, 4 channels in total
9604     * Speaker layout: Stereo plus left and right side speakers(SL, SR)
9605     * @syscap SystemCapability.Multimedia.Audio.Core
9606     * @since 11
9607     */
9608    CH_LAYOUT_QUAD_SIDE = 0x603,
9609    /**
9610     * Channel Layout For 2.0.2, 4 channels in total
9611     * Speaker layout: Stereo plus left and right top side speakers
9612     * @syscap SystemCapability.Multimedia.Audio.Core
9613     * @since 11
9614     */
9615    /**
9616     * Channel Layout For 2.0.2, 4 channels in total
9617     * Speaker layout: Stereo plus left and right top side speakers
9618     * @syscap SystemCapability.Multimedia.Audio.Core
9619     * @crossplatform
9620     * @since 12
9621     */
9622    CH_LAYOUT_2POINT0POINT2 = 0x3000000003,
9623    /**
9624     * Channel Layout For ORDER1-ACN-N3D First Order Ambisonic(FOA), 4 channels in total
9625     * First order, Ambisonic Channel Number(ACN) format, Normalization of three-D(N3D)
9626     * @syscap SystemCapability.Multimedia.Audio.Core
9627     * @since 11
9628     */
9629    CH_LAYOUT_AMB_ORDER1_ACN_N3D = 0x100000000001,
9630    /**
9631     * Channel Layout For ORDER1-ACN-SN3D FOA, 4 channels in total
9632     * First order, ACN format, Semi-Normalization of three-D(SN3D)
9633     * @syscap SystemCapability.Multimedia.Audio.Core
9634     * @since 11
9635     */
9636    CH_LAYOUT_AMB_ORDER1_ACN_SN3D = 0x100000001001,
9637    /**
9638     * Channel Layout For ORDER1-FUMA FOA, 4 channels in total
9639     * First order, Furse-Malham(FuMa) format
9640     * @syscap SystemCapability.Multimedia.Audio.Core
9641     * @since 11
9642     */
9643    CH_LAYOUT_AMB_ORDER1_FUMA = 0x100000000101,
9644    /**
9645     * Channel Layout For 4.1, 5 channels in total
9646     * Speaker layout: 4.0 plus LFE
9647     * @syscap SystemCapability.Multimedia.Audio.Core
9648     * @since 11
9649     */
9650    /**
9651     * Channel Layout For 4.1, 5 channels in total
9652     * Speaker layout: 4.0 plus LFE
9653     * @syscap SystemCapability.Multimedia.Audio.Core
9654     * @crossplatform
9655     * @since 12
9656     */
9657    CH_LAYOUT_4POINT1 = 0x10F,
9658    /**
9659     * Channel Layout For 5.0, 5 channels in total
9660     * Speaker layout: Surround plus two side speakers
9661     * @syscap SystemCapability.Multimedia.Audio.Core
9662     * @since 11
9663     */
9664    /**
9665     * Channel Layout For 5.0, 5 channels in total
9666     * Speaker layout: Surround plus two side speakers
9667     * @syscap SystemCapability.Multimedia.Audio.Core
9668     * @crossplatform
9669     * @since 12
9670     */
9671    CH_LAYOUT_5POINT0 = 0x607,
9672    /**
9673     * Channel Layout For 5.0-Back, 5 channels in total
9674     * Speaker layout: Surround plus two back speakers
9675     * @syscap SystemCapability.Multimedia.Audio.Core
9676     * @since 11
9677     */
9678    CH_LAYOUT_5POINT0_BACK = 0x37,
9679    /**
9680     * Channel Layout For 2.1.2, 5 channels in total
9681     * Speaker layout: 2.0.2 plus LFE
9682     * @syscap SystemCapability.Multimedia.Audio.Core
9683     * @since 11
9684     */
9685    CH_LAYOUT_2POINT1POINT2 = 0x300000000B,
9686    /**
9687     * Channel Layout For 3.0.2, 5 channels in total
9688     * Speaker layout: 2.0.2 plus FC
9689     * @syscap SystemCapability.Multimedia.Audio.Core
9690     * @since 11
9691     */
9692    CH_LAYOUT_3POINT0POINT2 = 0x3000000007,
9693    /**
9694     * Channel Layout For 5.1, 6 channels in total
9695     * Speaker layout: 5.0 plus LFE
9696     * @syscap SystemCapability.Multimedia.Audio.Core
9697     * @since 11
9698     */
9699    /**
9700     * Channel Layout For 5.1, 6 channels in total
9701     * Speaker layout: 5.0 plus LFE
9702     * @syscap SystemCapability.Multimedia.Audio.Core
9703     * @crossplatform
9704     * @since 12
9705     */
9706    CH_LAYOUT_5POINT1 = 0x60F,
9707    /**
9708     * Channel Layout For 5.1-Back, 6 channels in total
9709     * Speaker layout: 5.0-Back plus LFE
9710     * @syscap SystemCapability.Multimedia.Audio.Core
9711     * @since 11
9712     */
9713    CH_LAYOUT_5POINT1_BACK = 0x3F,
9714    /**
9715     * Channel Layout For 6.0, 6 channels in total
9716     * Speaker layout: 5.0 plus BC
9717     * @syscap SystemCapability.Multimedia.Audio.Core
9718     * @since 11
9719     */
9720    /**
9721     * Channel Layout For 6.0, 6 channels in total
9722     * Speaker layout: 5.0 plus BC
9723     * @syscap SystemCapability.Multimedia.Audio.Core
9724     * @crossplatform
9725     * @since 12
9726     */
9727    CH_LAYOUT_6POINT0 = 0x707,
9728    /**
9729     * Channel Layout For Hexagonal, 6 channels in total
9730     * Speaker layout: 5.0-Back plus BC
9731     * @syscap SystemCapability.Multimedia.Audio.Core
9732     * @since 11
9733     */
9734    /**
9735     * Channel Layout For Hexagonal, 6 channels in total
9736     * Speaker layout: 5.0-Back plus BC
9737     * @syscap SystemCapability.Multimedia.Audio.Core
9738     * @crossplatform
9739     * @since 12
9740     */
9741    CH_LAYOUT_HEXAGONAL = 0x137,
9742    /**
9743     * Channel Layout For 3.1.2, 6 channels in total
9744     * Speaker layout: 3.1 plus two top front speakers(TFL, TFR)
9745     * @syscap SystemCapability.Multimedia.Audio.Core
9746     * @since 11
9747     */
9748    CH_LAYOUT_3POINT1POINT2 = 0x500F,
9749    /**
9750     * Channel Layout For 6.0-Front, 6 channels in total
9751     * Speaker layout: Quad-Side plus left and right front center speakers(FLC, FRC)
9752     * @syscap SystemCapability.Multimedia.Audio.Core
9753     * @since 11
9754     */
9755    CH_LAYOUT_6POINT0_FRONT = 0x6C3,
9756    /**
9757     * Channel Layout For 6.1, 7 channels in total
9758     * Speaker layout: 5.1 plus BC
9759     * @syscap SystemCapability.Multimedia.Audio.Core
9760     * @since 11
9761     */
9762    /**
9763     * Channel Layout For 6.1, 7 channels in total
9764     * Speaker layout: 5.1 plus BC
9765     * @syscap SystemCapability.Multimedia.Audio.Core
9766     * @crossplatform
9767     * @since 12
9768     */
9769    CH_LAYOUT_6POINT1 = 0x70F,
9770    /**
9771     * Channel Layout For 6.1-Back, 7 channels in total
9772     * Speaker layout: 5.1-Back plus BC
9773     * @syscap SystemCapability.Multimedia.Audio.Core
9774     * @since 11
9775     */
9776    CH_LAYOUT_6POINT1_BACK = 0x13F,
9777    /**
9778     * Channel Layout For 6.1-Front, 7 channels in total
9779     * Speaker layout: 6.0-Front plus LFE
9780     * @syscap SystemCapability.Multimedia.Audio.Core
9781     * @since 11
9782     */
9783    CH_LAYOUT_6POINT1_FRONT = 0x6CB,
9784    /**
9785     * Channel Layout For 7.0, 7 channels in total
9786     * Speaker layout: 5.0 plus two back speakers
9787     * @syscap SystemCapability.Multimedia.Audio.Core
9788     * @since 11
9789     */
9790    /**
9791     * Channel Layout For 7.0, 7 channels in total
9792     * Speaker layout: 5.0 plus two back speakers
9793     * @syscap SystemCapability.Multimedia.Audio.Core
9794     * @crossplatform
9795     * @since 12
9796     */
9797    CH_LAYOUT_7POINT0 = 0x637,
9798    /**
9799     * Channel Layout For 7.0-Front, 7 channels in total
9800     * Speaker layout: 5.0 plus left and right front center speakers
9801     * @syscap SystemCapability.Multimedia.Audio.Core
9802     * @since 11
9803     */
9804    /**
9805     * Channel Layout For 7.0-Front, 7 channels in total
9806     * Speaker layout: 5.0 plus left and right front center speakers
9807     * @syscap SystemCapability.Multimedia.Audio.Core
9808     * @crossplatform
9809     * @since 12
9810     */
9811    CH_LAYOUT_7POINT0_FRONT = 0x6C7,
9812    /**
9813     * Channel Layout For 7.1, 8 channels in total
9814     * Speaker layout: 5.1 plus two back speakers
9815     * @syscap SystemCapability.Multimedia.Audio.Core
9816     * @since 11
9817     */
9818    /**
9819     * Channel Layout For 7.1, 8 channels in total
9820     * Speaker layout: 5.1 plus two back speakers
9821     * @syscap SystemCapability.Multimedia.Audio.Core
9822     * @crossplatform
9823     * @since 12
9824     */
9825    CH_LAYOUT_7POINT1 = 0x63F,
9826    /**
9827     * Channel Layout For Octagonal, 8 channels in total
9828     * Speaker layout: 5.0 plus BL, BR and BC.
9829     * @syscap SystemCapability.Multimedia.Audio.Core
9830     * @since 11
9831     */
9832    /**
9833     * Channel Layout For Octagonal, 8 channels in total
9834     * Speaker layout: 5.0 plus BL, BR and BC.
9835     * @syscap SystemCapability.Multimedia.Audio.Core
9836     * @crossplatform
9837     * @since 12
9838     */
9839    CH_LAYOUT_OCTAGONAL = 0x737,
9840    /**
9841     * Channel Layout For 5.1.2, 8 channels in total
9842     * Speaker layout: 5.1 plus two top side speakers.
9843     * @syscap SystemCapability.Multimedia.Audio.Core
9844     * @since 11
9845     */
9846    /**
9847     * Channel Layout For 5.1.2, 8 channels in total
9848     * Speaker layout: 5.1 plus two top side speakers.
9849     * @syscap SystemCapability.Multimedia.Audio.Core
9850     * @crossplatform
9851     * @since 12
9852     */
9853    CH_LAYOUT_5POINT1POINT2 = 0x300000060F,
9854    /**
9855     * Channel Layout For 7.1-Wide, 8 channels in total
9856     * Speaker layout: 5.1 plus left and right front center speakers.
9857     * @syscap SystemCapability.Multimedia.Audio.Core
9858     * @since 11
9859     */
9860    CH_LAYOUT_7POINT1_WIDE = 0x6CF,
9861    /**
9862     * Channel Layout For 7.1-Wide, 8 channels in total
9863     * Speaker layout: 5.1-Back plus left and right front center speakers.
9864     * @syscap SystemCapability.Multimedia.Audio.Core
9865     * @since 11
9866     */
9867    CH_LAYOUT_7POINT1_WIDE_BACK = 0xFF,
9868    /**
9869     * Channel Layout For ORDER2-ACN-N3D Higher Order Ambisonics(HOA), 9 channels in total
9870     * Second order, ACN format, N3D
9871     * @syscap SystemCapability.Multimedia.Audio.Core
9872     * @since 11
9873     */
9874    CH_LAYOUT_AMB_ORDER2_ACN_N3D = 0x100000000002,
9875    /**
9876     * Channel Layout For ORDER2-ACN-SN3D HOA, 9 channels in total
9877     * Second order, ACN format, SN3D
9878     * @syscap SystemCapability.Multimedia.Audio.Core
9879     * @since 11
9880     */
9881    CH_LAYOUT_AMB_ORDER2_ACN_SN3D = 0x100000001002,
9882    /**
9883     * Channel Layout For ORDER2-FUMA HOA, 9 channels in total
9884     * Second order, FuMa format
9885     * @syscap SystemCapability.Multimedia.Audio.Core
9886     * @since 11
9887     */
9888    CH_LAYOUT_AMB_ORDER2_FUMA = 0x100000000102,
9889    /**
9890     * Channel Layout For 5.1.4, 10 channels in total
9891     * Speaker layout: 5.1 plus four top speakers(TFL, TFR, TBL, TBR)
9892     * @syscap SystemCapability.Multimedia.Audio.Core
9893     * @since 11
9894     */
9895    /**
9896     * Channel Layout For 5.1.4, 10 channels in total
9897     * Speaker layout: 5.1 plus four top speakers(TFL, TFR, TBL, TBR)
9898     * @syscap SystemCapability.Multimedia.Audio.Core
9899     * @crossplatform
9900     * @since 12
9901     */
9902    CH_LAYOUT_5POINT1POINT4 = 0x2D60F,
9903    /**
9904     * Channel Layout For 7.1.2, 10 channels in total
9905     * Speaker layout: 7.1 plus two top side speakers
9906     * @syscap SystemCapability.Multimedia.Audio.Core
9907     * @since 11
9908     */
9909    /**
9910     * Channel Layout For 7.1.2, 10 channels in total
9911     * Speaker layout: 7.1 plus two top side speakers
9912     * @syscap SystemCapability.Multimedia.Audio.Core
9913     * @crossplatform
9914     * @since 12
9915     */
9916    CH_LAYOUT_7POINT1POINT2 = 0x300000063F,
9917    /**
9918     * Channel Layout For 7.1.4, 12 channels in total
9919     * Speaker layout: 7.1 plus four top speakers
9920     * @syscap SystemCapability.Multimedia.Audio.Core
9921     * @since 11
9922     */
9923    /**
9924     * Channel Layout For 7.1.4, 12 channels in total
9925     * Speaker layout: 7.1 plus four top speakers
9926     * @syscap SystemCapability.Multimedia.Audio.Core
9927     * @crossplatform
9928     * @since 12
9929     */
9930    CH_LAYOUT_7POINT1POINT4 = 0x2D63F,
9931    /**
9932     * Channel Layout For 10.2, 12 channels in total
9933     * Speaker layout: FL, FR, FC, TFL, TFR, BL, BR, BC, SL, SR, wide left(WL), and wide right(WR)
9934     * @syscap SystemCapability.Multimedia.Audio.Core
9935     * @since 11
9936     */
9937    /**
9938     * Channel Layout For 10.2, 12 channels in total
9939     * Speaker layout: FL, FR, FC, TFL, TFR, BL, BR, BC, SL, SR, wide left(WL), and wide right(WR)
9940     * @syscap SystemCapability.Multimedia.Audio.Core
9941     * @crossplatform
9942     * @since 12
9943     */
9944    CH_LAYOUT_10POINT2 = 0x180005737,
9945    /**
9946     * Channel Layout For 9.1.4, 14 channels in total
9947     * Speaker layout: 7.1.4 plus two wide speakers(WL, WR)
9948     * @syscap SystemCapability.Multimedia.Audio.Core
9949     * @since 11
9950     */
9951    CH_LAYOUT_9POINT1POINT4 = 0x18002D63F,
9952    /**
9953     * Channel Layout For 9.1.6, 16 channels in total
9954     * Speaker layout: 9.1.4 plus two top side speakers
9955     * @syscap SystemCapability.Multimedia.Audio.Core
9956     * @since 11
9957     */
9958    /**
9959     * Channel Layout For 9.1.6, 16 channels in total
9960     * Speaker layout: 9.1.4 plus two top side speakers
9961     * @syscap SystemCapability.Multimedia.Audio.Core
9962     * @crossplatform
9963     * @since 12
9964     */
9965    CH_LAYOUT_9POINT1POINT6 = 0x318002D63F,
9966    /**
9967     * Channel Layout For Hexadecagonal, 16 channels in total
9968     * Speaker layout: Octagonal plus two wide speakers, six top speakers(TFL, TFR, TFC, TBL, TBR, TBC)
9969     * @syscap SystemCapability.Multimedia.Audio.Core
9970     * @since 11
9971     */
9972    /**
9973     * Channel Layout For Hexadecagonal, 16 channels in total
9974     * Speaker layout: Octagonal plus two wide speakers, six top speakers(TFL, TFR, TFC, TBL, TBR, TBC)
9975     * @syscap SystemCapability.Multimedia.Audio.Core
9976     * @crossplatform
9977     * @since 12
9978     */
9979    CH_LAYOUT_HEXADECAGONAL = 0x18003F737,
9980    /**
9981     * Channel Layout For ORDER3-ACN-N3D HOA, 16 channels in total
9982     * Third order, ACN format, N3D
9983     * @syscap SystemCapability.Multimedia.Audio.Core
9984     * @since 11
9985     */
9986    /**
9987     * Channel Layout For ORDER3-ACN-N3D HOA, 16 channels in total
9988     * Third order, ACN format, N3D
9989     * @syscap SystemCapability.Multimedia.Audio.Core
9990     * @crossplatform
9991     * @since 12
9992     */
9993    CH_LAYOUT_AMB_ORDER3_ACN_N3D = 0x100000000003,
9994    /**
9995     * Channel Layout For ORDER3-ACN-SN3D HOA, 16 channels in total
9996     * Third order, ACN format, N3D
9997     * @syscap SystemCapability.Multimedia.Audio.Core
9998     * @since 11
9999     */
10000    /**
10001     * Channel Layout For ORDER3-ACN-SN3D HOA, 16 channels in total
10002     * Third order, ACN format, N3D
10003     * @syscap SystemCapability.Multimedia.Audio.Core
10004     * @crossplatform
10005     * @since 12
10006     */
10007    CH_LAYOUT_AMB_ORDER3_ACN_SN3D = 0x100000001003,
10008    /**
10009     * Channel Layout For ORDER3-FUMA HOA, 16 channels in total
10010     * Third order, FuMa format
10011     * @syscap SystemCapability.Multimedia.Audio.Core
10012     * @since 11
10013     */
10014    CH_LAYOUT_AMB_ORDER3_FUMA = 0x100000000103
10015  }
10016}
10017
10018export default audio;
10019