From b12978700eeb894a9fad75fef81cd05eead211c6 Mon Sep 17 00:00:00 2001 From: zyx0106 Date: Tue, 24 Jun 2025 11:35:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=93=8D=E5=BA=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyx0106 --- api/@ohos.multimedia.audio.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 7b6e419c51..c9e5b90f8d 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8539,6 +8539,31 @@ declare namespace audio { */ setDefaultOutputDevice(deviceType: DeviceType): Promise; + /** + * Sets the loudness gain of this stream. The default loudness gain is 0.0dB. + * The stream usage of the audio renderer must be {@link StreamUsage#STREAM_USAGE_MUSIC}, + * {@link StreamUsage#STREAM_USAGE_MOVIE} or {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * After calling this interface, the adjustment of loundness gain will take effect immediately. + * @param { number } loudnessGain - Loudness gain to set, expressed in dB. The value type is float. + * The loudness gain changes from -90.0dB to 24.0dB. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @throws { BusinessError } 6800104 - Operation is not supported on this renderer, e.g. the stream usage of this + * renderer is not one of {@link StreamUsage#STREAM_USAGE_MUSIC}, {@link StreamUsage#STREAM_USAGE_MOVIE} or + * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}, higi-resolution playback. + * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 20 + */ + setLoudnessGain(loudnessGain: number): Promise; + + /** + * Gets loudness gain of this stream. + * @returns { number } Returns one float value. + * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 20 + */ + getLoudnessGain(): number; + /** * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is * triggered when audio playback is interrupted. -- Gitee From f6ee892ac487357dd5b941a61e3cde633db43479 Mon Sep 17 00:00:00 2001 From: zyx0106 Date: Tue, 24 Jun 2025 11:57:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zyx0106 --- api/@ohos.multimedia.audio.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index c9e5b90f8d..51e751d8c4 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8550,7 +8550,7 @@ declare namespace audio { * @throws { BusinessError } 6800101 - Parameter verification failed. * @throws { BusinessError } 6800104 - Operation is not supported on this renderer, e.g. the stream usage of this * renderer is not one of {@link StreamUsage#STREAM_USAGE_MUSIC}, {@link StreamUsage#STREAM_USAGE_MOVIE} or - * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}, higi-resolution playback. + * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}, or this renderer is routed through the high-resolution playback path. * @syscap SystemCapability.Multimedia.Audio.Renderer * @since 20 */ -- Gitee