From d54c6f7291621a05e30d54084115ec1f0f2baaf6 Mon Sep 17 00:00:00 2001 From: zhaijunwei Date: Mon, 1 Apr 2024 20:30:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B3=E9=A2=91NDK=E6=96=B0=E5=A2=9EAudioRen?= =?UTF-8?q?derer=E6=89=93=E6=96=AD=E6=A8=A1=E5=BC=8F=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaijunwei --- .../common/native_audiostream_base.h | 20 +++++++++++++++++++ .../common/native_audiostreambuilder.h | 12 +++++++++++ multimedia/audio_framework/ohaudio.ndk.json | 4 ++++ 3 files changed, 36 insertions(+) diff --git a/multimedia/audio_framework/common/native_audiostream_base.h b/multimedia/audio_framework/common/native_audiostream_base.h index e0db659ce..204a9a4c7 100644 --- a/multimedia/audio_framework/common/native_audiostream_base.h +++ b/multimedia/audio_framework/common/native_audiostream_base.h @@ -420,6 +420,26 @@ typedef enum { AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION = 7 } OH_AudioStream_SourceType; +/** + * Defines the audio interrupt mode. + * + * @since 12 + */ +typedef enum { + /** + * Share mode + * + * @since 12 + */ + AUDIOSTREAM_INTERRUPT_MODE_SHARE = 0, + /** + * Independent mode + * + * @since 12 + */ + AUDIOSTREAM_INTERRUPT_MODE_INDEPENDENT = 1 +} OH_AudioInterrupt_Mode; + /** * Declaring the audio stream builder. * The instance of builder is used for creating audio stream. diff --git a/multimedia/audio_framework/common/native_audiostreambuilder.h b/multimedia/audio_framework/common/native_audiostreambuilder.h index 44b1e4ae2..c529d90e6 100644 --- a/multimedia/audio_framework/common/native_audiostreambuilder.h +++ b/multimedia/audio_framework/common/native_audiostreambuilder.h @@ -227,6 +227,18 @@ OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer(OH_AudioStreamBuild OH_AudioStream_Result OH_AudioStreamBuilder_SetFrameSizeInCallback(OH_AudioStreamBuilder* builder, int32_t frameSize); +/* + * Set the interrupt mode of the stream client + * + * @since 12 + * + * @param builder Reference provided by OH_AudioStreamBuilder_Create() + * @param mode The audio interrupt mode + * @return {@link #AUDIOSTREAM_SUCCESS} or an undesired error. + */ +OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInterruptMode(OH_AudioStreamBuilder* builder, + OH_AudioInterrupt_Mode mode); + #ifdef __cplusplus } #endif diff --git a/multimedia/audio_framework/ohaudio.ndk.json b/multimedia/audio_framework/ohaudio.ndk.json index 39b8be0ec..1b19c5022 100644 --- a/multimedia/audio_framework/ohaudio.ndk.json +++ b/multimedia/audio_framework/ohaudio.ndk.json @@ -222,5 +222,9 @@ { "first_introduced":"12", "name": "OH_AudioCapturer_GetOverflowCount" + }, + { + "first_introduced":"12", + "name": "OH_AudioStreamBuilder_SetRendererInterruptMode" } ] -- Gitee