openharmony 鸿蒙 capi-native-audio-session-base-h

2026-08-25 浏览 (1)

native_audio_session_base.h

Overview

The file declares the basic data struct of an audio session.

File to include: <ohaudio/native_audio_session_base.h>

Library: libohaudio.so

System capability: SystemCapability.Multimedia.Audio.Core

Since: 24

Related module: OHAudio

Summary

Structs

Nametypedef KeywordDescription
OH_AudioSession_StrategyOH_AudioSession_StrategyDescribes the audio session strategy.

Enums

Nametypedef KeywordDescription
OH_AudioSession_BehaviorFlagsOH_AudioSession_BehaviorFlagsEnumerates the audio session behavior flags.
OH_AudioSession_ConcurrencyModeOH_AudioSession_ConcurrencyModeEnumerates the audio concurrency modes.

Enum Description

OH_AudioSession_BehaviorFlags

enum OH_AudioSession_BehaviorFlags

Description

Enumerates the audio session behavior flags.

Since: 24

Enum ItemDescription
DEFAULT_BEHAVIOR = 0x00000000Default behavior, which is used to clear the session behavior flag.
Since: 24
VOIP_PRIVACY_TYPE_PUBLIC = 0x00000001Non-private VoIP, which can be recorded. Concurrent recording of VoIP streams and other application streams are supported.
Since: 26.0.0
MUTE_WHEN_INTERRUPTED = 0x00000002Mute the audio stream when it is interrupted. You need to call OH_AudioSessionManager_SetBehavior to set the behavior and call OH_AudioSessionManager_SetScene to make it take effect. An application will receive an OH_AudioStream_Usage.AUDIOSTREAM_INTERRUPT_HINT_MUTE notification when playback is muted, and an OH_AudioStream_Usage.AUDIOSTREAM_INTERRUPT_HINT_UNMUTE notification when the playback is unmuted.
Since: 24

OH_AudioSession_ConcurrencyMode

enum OH_AudioSession_ConcurrencyMode

Description

Enumerates the audio concurrency modes.

Since: 12

Enum ItemDescription
CONCURRENCY_DEFAULT = 0The system strategy is used by default.
CONCURRENCY_MIX_WITH_OTHERS = 1The current application mixes audio with other applications during playback.
CONCURRENCY_DUCK_OTHERS = 2The current application ducks the volume of other playing applications during playback.
CONCURRENCY_PAUSE_OTHERS = 3The current application pauses other playing applications during playback.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-native-audiostreambuilder-h

openharmony 鸿蒙 capi-ohaudiosuite

openharmony 鸿蒙 js-apis-inner-multimedia-systemSoundPlayer

openharmony 鸿蒙 arkts-apis-audio-i

openharmony 鸿蒙 capi-ohaudio

openharmony 鸿蒙 capi-ohmidi

openharmony 鸿蒙 arkts-apis-audio-AudioManager

openharmony 鸿蒙 capi-ohaudiosuite-oh-audiosuite-spacerenderpositionparams

openharmony 鸿蒙 capi-ohaudio-oh-audiostreaminfo

openharmony 鸿蒙 errorcode-ringtone

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/aq79EJjL