ohaudio-sys 0.1.0

Raw Bindings to the audio module of OpenHarmony
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::audio_common::OH_AudioCommon_Result;
#[cfg(feature = "api-21")]
use crate::audio_device_base::{
    OH_AudioDeviceDescriptor, OH_AudioDevice_ChangeType, OH_AudioDevice_Usage,
};
#[cfg(feature = "api-20")]
use crate::audio_device_base::{OH_AudioDeviceDescriptorArray, OH_AudioDevice_Type};
#[cfg(feature = "api-20")]
use crate::audiostream_base::OH_AudioStream_DeviceChangeReason;

/// Declare the audio session manager.
/// The handle of audio session manager is used for audio session related functions.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
pub struct OH_AudioSessionManager {
    _unused: [u8; 0],
}
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AudioSession_ConcurrencyMode {
    /// default mode
    pub const CONCURRENCY_DEFAULT: OH_AudioSession_ConcurrencyMode =
        OH_AudioSession_ConcurrencyMode(0);
    /// mix with others mode
    pub const CONCURRENCY_MIX_WITH_OTHERS: OH_AudioSession_ConcurrencyMode =
        OH_AudioSession_ConcurrencyMode(1);
    /// duck others mode
    pub const CONCURRENCY_DUCK_OTHERS: OH_AudioSession_ConcurrencyMode =
        OH_AudioSession_ConcurrencyMode(2);
    /// pause others mode
    pub const CONCURRENCY_PAUSE_OTHERS: OH_AudioSession_ConcurrencyMode =
        OH_AudioSession_ConcurrencyMode(3);
}
#[repr(transparent)]
/// Declare the audio concurrency modes.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_ConcurrencyMode(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AudioSession_Scene {
    /// scene for media
    pub const AUDIO_SESSION_SCENE_MEDIA: OH_AudioSession_Scene = OH_AudioSession_Scene(0);
    /// scene for game
    pub const AUDIO_SESSION_SCENE_GAME: OH_AudioSession_Scene = OH_AudioSession_Scene(1);
    /// scene for voice communication
    pub const AUDIO_SESSION_SCENE_VOICE_COMMUNICATION: OH_AudioSession_Scene =
        OH_AudioSession_Scene(2);
}
#[repr(transparent)]
/// Declare the audio session scene.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_Scene(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AudioSession_StateChangeHint {
    /// Resume the playback
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_RESUME: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(0);
    /// paused/pause the playback
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_PAUSE: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(1);
    /// stopped/stop the playback.
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_STOP: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(2);
    /// stopped/stop the playback due to no audio stream for a long time.
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_TIME_OUT_STOP: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(3);
    /// Ducked the playback. (In ducking, the audio volume is reduced, but not silenced.)
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_DUCK: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(4);
    /// Unducked the playback.
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_UNDUCK: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(5);
    /// Suggests to mute the playback because there is another application begin to play nonmixable
    /// audio, application can decide whether to mute.
    /// If interrupt strategy is duck, [`#AUDIO_SESSION_STATE_CHANGE_HINT_DUCK`] will replace mute suggestion event,
    /// but application can still decide to mute when receive hint duck.
    ///
    ///
    /// Available since API-level: 23
    #[cfg(feature = "api-23")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_MUTE_SUGGESTION: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(6);
    /// Suggest to unmute the playback because another application's nonmixable audio ends,
    /// application can decide whether to mute.
    /// If interrupt strategy is unduck, [`#AUDIO_SESSION_STATE_CHANGE_HINT_UNDUCK`] will replace unmute
    /// suggestion event, but application can still decide to unmute when receive hint unduck.
    ///
    ///
    /// Available since API-level: 23
    #[cfg(feature = "api-23")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
    pub const AUDIO_SESSION_STATE_CHANGE_HINT_UNMUTE_SUGGESTION: OH_AudioSession_StateChangeHint =
        OH_AudioSession_StateChangeHint(7);
}
#[repr(transparent)]
/// Declare the audio session state change hints.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_StateChangeHint(pub ::core::ffi::c_uint);
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
impl OH_AudioSession_OutputDeviceChangeRecommendedAction {
    /// Recommend to continue the playback.
    pub const DEVICE_CHANGE_RECOMMEND_TO_CONTINUE:
        OH_AudioSession_OutputDeviceChangeRecommendedAction =
        OH_AudioSession_OutputDeviceChangeRecommendedAction(0);
    /// recommend to stop the playback.
    pub const DEVICE_CHANGE_RECOMMEND_TO_STOP: OH_AudioSession_OutputDeviceChangeRecommendedAction =
        OH_AudioSession_OutputDeviceChangeRecommendedAction(1);
}
#[repr(transparent)]
/// Declare the recommend action when device change.
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_OutputDeviceChangeRecommendedAction(pub ::core::ffi::c_uint);
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
impl OH_AudioSession_DeactivatedReason {
    /// deactivated because of lower priority
    pub const DEACTIVATED_LOWER_PRIORITY: OH_AudioSession_DeactivatedReason =
        OH_AudioSession_DeactivatedReason(0);
    /// deactivated because of timing out
    pub const DEACTIVATED_TIMEOUT: OH_AudioSession_DeactivatedReason =
        OH_AudioSession_DeactivatedReason(1);
}
#[repr(transparent)]
/// Declare the audio deactivated reasons.
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_DeactivatedReason(pub ::core::ffi::c_uint);
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
impl OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory {
    /// Not prefer to use bluetooth and nearlink record.
    pub const PREFERRED_NONE: OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory =
        OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory(0);
    /// Prefer to use bluetooth and nearlink record.
    /// However, whether to use low latency or high quality recording
    /// depends on system.
    pub const PREFERRED_DEFAULT: OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory =
        OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory(1);
    /// Prefer to use bluetooth and nearlink low latency mode to record.
    pub const PREFERRED_LOW_LATENCY: OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory =
        OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory(2);
    /// Prefer to use bluetooth and nearlink high quality mode to record.
    pub const PREFERRED_HIGH_QUALITY: OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory =
        OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory(3);
}
#[repr(transparent)]
/// Enumerates the categories application prefer to use
/// when recording with bluetooth and nearlink.
///
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory(pub ::core::ffi::c_uint);
/// declare the audio session strategy
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioSession_Strategy {
    /// audio session concurrency mode
    pub concurrencyMode: OH_AudioSession_ConcurrencyMode,
}
/// declare the audio session deactivated event
///
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioSession_DeactivatedEvent {
    /// audio session deactivated reason
    pub reason: OH_AudioSession_DeactivatedReason,
}
/// declare the audio session state change event
///
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_AudioSession_StateChangedEvent {
    /// audio session state change hints.
    pub stateChangeHint: OH_AudioSession_StateChangeHint,
}
/// This function pointer will point to the callback function that
/// is used to return the audio session state change event.
///
/// # Arguments
///
/// * `event` - the [`#OH_AudioSession_StateChangedEvent`] state change triggering event.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub type OH_AudioSession_StateChangedCallback =
    ::core::option::Option<unsafe extern "C" fn(event: OH_AudioSession_StateChangedEvent)>;
/// This function pointer will point to the callback function that
/// is used to return the changing audio device descriptors.
/// There may be more than one audio device descriptor returned.
///
/// # Arguments
///
/// * `type` - the [`OH_AudioDevice_ChangeType`] is connect or disconnect.
///
/// * `audioDeviceDescriptorArray` - the [`OH_AudioDeviceDescriptorArray`]
/// pointer variable which will be set the audio device descriptors value.
/// Do not release the audioDeviceDescriptorArray pointer separately
/// instead call [`OH_AudioSessionManager_ReleaseDevices`] to release the DeviceDescriptor array
/// when it is no use anymore.
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub type OH_AudioSession_AvailableDeviceChangedCallback = ::core::option::Option<
    unsafe extern "C" fn(
        type_: OH_AudioDevice_ChangeType,
        audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
    ),
>;
/// This function pointer will point to the callback function that
/// is used to return the audio session input device change event.
///
/// # Arguments
///
/// * `audioDeviceDescriptorArray` - the [`OH_AudioDeviceDescriptorArray`]
/// pointer variable which will be set the audio input device descriptors value.
/// Do not release the audioDeviceDescriptorArray pointer separately
/// instead call [`OH_AudioSessionManager_ReleaseDevices`]
/// to release the DeviceDescriptor array when it is no use anymore.
///
/// * `changeReason` - the [`#OH_AudioStream_DeviceChangeReason`] indicates
/// that why does the input device changes.
///
/// Available since API-level: 21
#[cfg(feature = "api-21")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
pub type OH_AudioSession_CurrentInputDeviceChangedCallback = ::core::option::Option<
    unsafe extern "C" fn(
        devices: *mut OH_AudioDeviceDescriptorArray,
        changeReason: OH_AudioStream_DeviceChangeReason,
    ),
>;
/// This function pointer will point to the callback function that
/// is used to return the audio session device change event.
///
/// # Arguments
///
/// * `audioDeviceDescriptorArray` - the [`OH_AudioDeviceDescriptorArray`]
/// pointer variable which will be set the audio device descriptors value.
/// Do not release the audioDeviceDescriptorArray pointer separately
/// instead call [`OH_AudioSessionManager_ReleaseDevices`]
/// to release the DeviceDescriptor array when it is no use anymore.
///
/// * `changeReason` - the [`#OH_AudioStream_DeviceChangeReason`] indicates that why does the device changes.
///
/// * `recommendedAction` - the [`#OH_AudioSession_OutputDeviceChangeRecommendedAction`]
/// recommend action when device change.
///
/// Available since API-level: 20
#[cfg(feature = "api-20")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
pub type OH_AudioSession_CurrentOutputDeviceChangedCallback = ::core::option::Option<
    unsafe extern "C" fn(
        devices: *mut OH_AudioDeviceDescriptorArray,
        changeReason: OH_AudioStream_DeviceChangeReason,
        recommendedAction: OH_AudioSession_OutputDeviceChangeRecommendedAction,
    ),
>;
/// This function pointer will point to the callback function that
/// is used to return the audio session deactivated event.
///
/// # Arguments
///
/// * `event` - the [`#OH_AudioSession_DeactivatedEvent`] deactivated triggering event.
///
/// Available since API-level: 12
#[cfg(feature = "api-12")]
#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
pub type OH_AudioSession_DeactivatedCallback =
    ::core::option::Option<unsafe extern "C" fn(event: OH_AudioSession_DeactivatedEvent) -> i32>;
extern "C" {
    /// Fetch the audio session manager handle.
    /// The audio session manager handle should be the first parameter in audio session related functions
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// which will be returned as the output parameter
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioManager_GetAudioSessionManager(
        audioSessionManager: *mut *mut OH_AudioSessionManager,
    ) -> OH_AudioCommon_Result;
    /// Activate the audio session for the current pid application.
    /// If [`#OH_AudioSessionManager_SetScene`] is called, it will take focus when calling this method.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `strategy` - pointer of [`#OH_AudioSession_Strategy`]
    /// which is used for setting audio session strategy
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_REULT_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE`] if system illegal state
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioSessionManager_ActivateAudioSession(
        audioSessionManager: *mut OH_AudioSessionManager,
        strategy: *const OH_AudioSession_Strategy,
    ) -> OH_AudioCommon_Result;
    /// Deactivate the audio session for the current pid application.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_REULT_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE`] if system illegal state
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioSessionManager_DeactivateAudioSession(
        audioSessionManager: *mut OH_AudioSessionManager,
    ) -> OH_AudioCommon_Result;
    /// Querying whether the current pid application has an activated audio session.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// # Returns
    ///
    /// * True when the current pid application has an activated audio session
    /// False when it does not
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioSessionManager_IsAudioSessionActivated(
        audioSessionManager: *mut OH_AudioSessionManager,
    ) -> bool;
    /// Register the audio session deactivated event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_DeactivatedCallback`] which is used
    /// to receive the deactivated event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioSessionManager_RegisterSessionDeactivatedCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_DeactivatedCallback,
    ) -> OH_AudioCommon_Result;
    /// Unregister the audio session deactivated event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_DeactivatedCallback`] which is used
    /// to receive the deactivated event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    ///
    /// Available since API-level: 12
    #[cfg(feature = "api-12")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
    pub fn OH_AudioSessionManager_UnregisterSessionDeactivatedCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_DeactivatedCallback,
    ) -> OH_AudioCommon_Result;
    /// Set scene for audio session.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `scene` - the [`#OH_AudioSession_Scene`]
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE`] if system illegal state
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_SetScene(
        audioSessionManager: *mut OH_AudioSessionManager,
        scene: OH_AudioSession_Scene,
    ) -> OH_AudioCommon_Result;
    /// Register the audio session state change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_StateChangedCallback`] which is used
    /// to receive the state change event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`AUDIOCOMMON_RESULT_ERROR_NO_MEMORY`] No memory error
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_RegisterStateChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_StateChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Unregister the audio session state change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_StateChangedCallback`] which is used
    /// to receive the state change event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_UnregisterStateChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_StateChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Sets the default output device.
    /// This function applys on audiorenderers whose StreamUsage are
    /// STREAM_USAGE_VOICE_COMMUNICATION/STREAM_USAGE_VIDEO_COMMUNICATION/STREAM_USAGE_VOICE_MESSAGE.
    /// Setting the device will only takes effect if no other accessory such as headphones are in use
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `deviceType` - The target device. The available deviceTypes are:
    /// EARPIECE: Built-in earpiece
    /// SPEAKER: Built-in speaker
    /// DEFAULT: System default output device
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_SetDefaultOutputDevice(
        audioSessionManager: *mut OH_AudioSessionManager,
        deviceType: OH_AudioDevice_Type,
    ) -> OH_AudioCommon_Result;
    /// Gets the default output device.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `deviceType` - The target device.The available deviceTypes are:
    /// EARPIECE: Built-in earpiece
    /// SPEAKER: Built-in speaker
    /// DEFAULT: System default output device
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE`] if system illegal state
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_GetDefaultOutputDevice(
        audioSessionManager: *mut OH_AudioSessionManager,
        deviceType: *mut OH_AudioDevice_Type,
    ) -> OH_AudioCommon_Result;
    /// Release the audio device descriptor array object.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `audioDeviceDescriptorArray` - Audio device descriptors should be released.
    ///
    /// # Returns
    ///
    /// * [`AUDIOCOMMON_RESULT_SUCCESS`] If the execution is successful.
    /// or [`AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// 1.The param of audioSessionManager is nullptr;
    /// 2.The param of audioDeviceDescriptorArray is nullptr.
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_ReleaseDevices(
        audioSessionManager: *mut OH_AudioSessionManager,
        audioDeviceDescriptorArray: *mut OH_AudioDeviceDescriptorArray,
    ) -> OH_AudioCommon_Result;
    /// Register the audio session device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_CurrentOutputDeviceChangedCallback`] which is used
    /// to receive the device change event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`AUDIOCOMMON_RESULT_ERROR_NO_MEMORY`] No memory error
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_RegisterCurrentOutputDeviceChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_CurrentOutputDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Unregister the audio session device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `callback` - the [`#OH_AudioSession_CurrentOutputDeviceChangedCallback`] which is used
    /// to receive the device change event
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] if system state error
    ///
    /// Available since API-level: 20
    #[cfg(feature = "api-20")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-20")))]
    pub fn OH_AudioSessionManager_UnregisterCurrentOutputDeviceChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_CurrentOutputDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Get available devices by device usage.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`] handle returned
    /// by [`OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `deviceUsage` - the [`OH_AudioDevice_Usage`] which is used as
    /// the filter parameter for get the available devices.
    ///
    /// * `audioDeviceDescriptorArray` - the [`OH_AudioDeviceDescriptorArray`]
    /// pointer variable which will be set the audio device descriptors value
    /// Do not release the audioDeviceDescriptorArray pointer separately
    /// instead call [`OH_AudioSessionManager_ReleaseDevices`] to release the DeviceDescriptor array
    /// when it is no use anymore.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_GetAvailableDevices(
        audioSessionManager: *mut OH_AudioSessionManager,
        deviceUsage: OH_AudioDevice_Usage,
        audioDeviceDescriptorArray: *mut *mut OH_AudioDeviceDescriptorArray,
    ) -> OH_AudioCommon_Result;
    /// Register available device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `deviceUsage` - the [`OH_AudioDevice_Usage`] which is used as
    /// the filter parameter for register the available devices change event.
    ///
    /// * `callback` - the [`#OH_AudioSession_AvailableDeviceChangedCallback`] which is used
    /// to receive available device change event.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_RegisterAvailableDevicesChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        deviceUsage: OH_AudioDevice_Usage,
        callback: OH_AudioSession_AvailableDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Unregister available device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `callback` - the [`#OH_AudioSession_AvailableDeviceChangedCallback`] which is used
    /// to receive the device change event.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_UnregisterAvailableDevicesChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_AvailableDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Sets the media input device.
    /// This function is not valid for call recording, whose SourceType is
    /// SOURCE_TYPE_VOICE_CALL or SOURCE_TYPE_VOICE_COMMUNICATION.
    /// In scenarios where there are concurrent recording streams with higher priority,
    /// the actual input device used by the application may differ from the selected one.
    /// The application can use [`OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback`]
    /// to register a callback to listen for the actual input device.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`] handle returned
    /// by [`OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `deviceDescriptor` - The target device. The available device must be in the array returned
    /// by [`OH_AudioSessionManager_GetAvailableDevices`].
    /// When the nullptr is passed, system will clear the last selection.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_SelectMediaInputDevice(
        audioSessionManager: *mut OH_AudioSessionManager,
        deviceDescriptor: *mut OH_AudioDeviceDescriptor,
    ) -> OH_AudioCommon_Result;
    /// Gets the selected media input device.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `audioDeviceDescriptor` - The target device set by
    /// [`OH_AudioSessionManager_SelectMediaInputDevice`] or
    /// device with AUDIO_DEVICE_TYPE_INVALID if not set yet.
    /// Do not release the audioDeviceDescriptor pointer separately,
    /// instead call [`OH_AudioSessionManager_ReleaseDevice`] to release it
    /// when it is no use anymore.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_GetSelectedMediaInputDevice(
        audioSessionManager: *mut OH_AudioSessionManager,
        audioDeviceDescriptor: *mut *mut OH_AudioDeviceDescriptor,
    ) -> OH_AudioCommon_Result;
    /// Sets the prefered record category with bluetooth and nearlink device.
    /// The application can set this category before bluetooth and nearlink connected, and the system will
    /// prefer to use bluetooth and nearlink to record when the device connected.
    /// In scenarios where there are concurrent recording streams with higher priority,
    /// the actual input device used by the application may differ from the prefered one.
    /// The application can use [`OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback`]
    /// to register a callback to listen for the actual input device.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`] handle returned
    /// by [`OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `category` - The category application prefer to use when recording with bluetooth and nearlink.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_SetBluetoothAndNearlinkPreferredRecordCategory(
        audioSessionManager: *mut OH_AudioSessionManager,
        category: OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory,
    ) -> OH_AudioCommon_Result;
    /// Gets the prefered record category with bluetooth and nearlink device.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`] handle returned
    /// by [`OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `category` - The category application prefer to use when recording with bluetooth and nearlink.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_GetBluetoothAndNearlinkPreferredRecordCategory(
        audioSessionManager: *mut OH_AudioSessionManager,
        category: *mut OH_AudioSession_BluetoothAndNearlinkPreferredRecordCategory,
    ) -> OH_AudioCommon_Result;
    /// Register the audio session input device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `callback` - the [`#OH_AudioSession_CurrentInputDeviceChangedCallback`] which is used
    /// to receive the input device change event.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`AUDIOCOMMON_RESULT_ERROR_NO_MEMORY`] No memory error.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_RegisterCurrentInputDeviceChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_CurrentInputDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Unregister the audio session input device change event callback.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `callback` - the [`#OH_AudioSession_CurrentInputDeviceChangedCallback`] which is used
    /// to receive the input device change event.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] if execution succeeds.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, System error.
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_UnregisterCurrentInputDeviceChangeCallback(
        audioSessionManager: *mut OH_AudioSessionManager,
        callback: OH_AudioSession_CurrentInputDeviceChangedCallback,
    ) -> OH_AudioCommon_Result;
    /// Release the audio device descriptor object.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`]
    ///
    /// * `audioDeviceDescriptor` - Audio device descriptor to release.
    ///
    /// # Returns
    ///
    /// * [`AUDIOCOMMON_RESULT_SUCCESS`] If the execution is successful.
    /// or [`AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] if parameter validation fails
    ///
    /// Available since API-level: 21
    #[cfg(feature = "api-21")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-21")))]
    pub fn OH_AudioSessionManager_ReleaseDevice(
        audioSessionManager: *mut OH_AudioSessionManager,
        audioDeviceDescriptor: *mut OH_AudioDeviceDescriptor,
    ) -> OH_AudioCommon_Result;
    /// Enables mute suggestion callback function when using [`#CONCURRENCY_MIX_WITH_OTHERS`] mode.
    /// Usually when using mix mode, application won't receive state change event when there is another audio playing
    /// simultaneously. But in some scenarios, like game or radio, the application may intend to mute its audio to
    /// achieve better user experience.
    /// If enabled, the mute and unmute suggestion hint will be sent by [`#OH_AudioSession_StateChangedCallback`]
    /// registered by [`#OH_AudioSessionManager_RegisterStateChangeCallback`]. Mute suggestion means there is
    /// another application starting non-mixable audio.
    /// This function only supports audio session with [`#OH_AudioSession_Scene`] set and activated with
    /// [`#CONCURRENCY_MIX_WITH_OTHERS`] mode. And it takes effect only once during activation, so application
    /// need to enable it every time before activation.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// * `enable` - Sets true to enable mute suggestion while registering session state change event callback.
    ///
    /// # Returns
    ///
    /// * [`#AUDIOCOMMON_RESULT_SUCCESS`] If the execution is successful.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM`] Parameter validation fails.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_ILLEGAL_STATE`] Function is called without setting
    /// [`#OH_AudioSession_Scene`] or called after audio session activation.
    /// or [`#AUDIOCOMMON_RESULT_ERROR_SYSTEM`] Audio client call audio service error, system internal error.
    ///
    /// Available since API-level: 23
    #[cfg(feature = "api-23")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
    pub fn OH_AudioSessionManager_EnableMuteSuggestionWhenMixWithOthers(
        audioSessionManager: *mut OH_AudioSessionManager,
        enable: bool,
    ) -> OH_AudioCommon_Result;
    /// Returns if there is any other application playing audio in media usage, including media session activated.
    ///
    /// # Arguments
    ///
    /// * `audioSessionManager` - the [`#OH_AudioSessionManager`]
    /// returned by the [`#OH_AudioManager_GetAudioSessionManager`].
    ///
    /// # Returns
    ///
    /// * True if there is other application playing audio in media usage.
    ///
    /// Available since API-level: 23
    #[cfg(feature = "api-23")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-23")))]
    pub fn OH_AudioSessionManager_IsOtherMediaPlaying(
        audioSessionManager: *mut OH_AudioSessionManager,
    ) -> bool;
}