From ac0ffdb61db667cb662ffc9431526420781e8e47 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 29 Mar 2025 09:48:46 +0800 Subject: [PATCH 1/6] =?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: Wang Chongteng --- api/@ohos.multimedia.audio.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 62ec8b3b16..e389258140 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8064,6 +8064,33 @@ declare namespace audio { */ setDefaultOutputDevice(deviceType: DeviceType): Promise; + /** + * Sets the loudness gain for a stream. 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}. This method uses a promise to return the result. + * @param { number } loudnessGain - Loudness gain to set, expressed in dB. The value type is float, form -90.0 to 24.0. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @throws { BusinessError } 6800103 - Operation not permit at current state. e.g. the stream usage of the audio + * renderer is not {@link StreamUsage#STREAM_USAGE_MUSIC}, {@link StreamUsage#STREAM_USAGE_MOVIE} or + * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * @syscap SystemCapability.Multimedia.Audio.Renderer + * @crossplatform + * @since 19 + */ + setLoudnessGain(loudnessGain: number): Promise; + + /** + * Gets loudness gain of this stream. + * @returns { number } Returns one float value. + * @syscap SystemCapability.Multimedia.Audio.Renderer + * @since 19 + */ + 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 5cc6c08237caf061f1ac7aa0cce0bb4735a01259 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 29 Mar 2025 10:26:44 +0800 Subject: [PATCH 2/6] =?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: Wang Chongteng --- 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 e389258140..51986628f6 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8065,7 +8065,7 @@ declare namespace audio { setDefaultOutputDevice(deviceType: DeviceType): Promise; /** - * Sets the loudness gain for a stream. The stream usage of the audio renderer must be + * Sets the loudness gain of this stream. 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}. This method uses a promise to return the result. * @param { number } loudnessGain - Loudness gain to set, expressed in dB. The value type is float, form -90.0 to 24.0. -- Gitee From 15ce9a00d568cd3c6de83017401ecc8127cfe059 Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 29 Mar 2025 10:36:55 +0800 Subject: [PATCH 3/6] =?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: Wang Chongteng --- api/@ohos.multimedia.audio.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 51986628f6..c85fc34c2d 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8068,15 +8068,18 @@ declare namespace audio { * Sets the loudness gain of this stream. 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}. This method uses a promise to return the result. - * @param { number } loudnessGain - Loudness gain to set, expressed in dB. The value type is float, form -90.0 to 24.0. + * @param { number } loudnessGain - Loudness gain to set, expressed in dB. + * The value type is float, form -90.0 to 24.0. * @returns { Promise } Promise used to return the result. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; * 2.Incorrect parameter types. * @throws { BusinessError } 6800101 - Parameter verification failed. - * @throws { BusinessError } 6800103 - Operation not permit at current state. e.g. the stream usage of the audio - * renderer is not {@link StreamUsage#STREAM_USAGE_MUSIC}, {@link StreamUsage#STREAM_USAGE_MOVIE} or - * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * @throws { BusinessError } 6800103 - Operation not permit at current state. + * e.g. the stream usage of the audio renderer is not + * {@link StreamUsage#STREAM_USAGE_MUSIC}, + * {@link StreamUsage#STREAM_USAGE_MOVIE} or + * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. * @syscap SystemCapability.Multimedia.Audio.Renderer * @crossplatform * @since 19 -- Gitee From 38e6b827eabfc88aa6b5de28483200e7f0a4f03b Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 29 Mar 2025 11:15:40 +0800 Subject: [PATCH 4/6] =?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: Wang Chongteng --- api/@ohos.multimedia.audio.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index c85fc34c2d..e32a740b50 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8082,7 +8082,7 @@ declare namespace audio { * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. * @syscap SystemCapability.Multimedia.Audio.Renderer * @crossplatform - * @since 19 + * @since 20 */ setLoudnessGain(loudnessGain: number): Promise; @@ -8090,7 +8090,7 @@ declare namespace audio { * Gets loudness gain of this stream. * @returns { number } Returns one float value. * @syscap SystemCapability.Multimedia.Audio.Renderer - * @since 19 + * @since 20 */ getLoudnessGain(): number; -- Gitee From e819ed2c67ae2c386c2bc9d55083d5a19816c36d Mon Sep 17 00:00:00 2001 From: Wang Chongteng Date: Sat, 29 Mar 2025 11:43:58 +0800 Subject: [PATCH 5/6] =?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: Wang Chongteng --- api/@ohos.multimedia.audio.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index e32a740b50..d81e65802f 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8065,11 +8065,12 @@ declare namespace audio { setDefaultOutputDevice(deviceType: DeviceType): Promise; /** - * Sets the loudness gain of this stream. 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}. This method uses a promise to return the result. - * @param { number } loudnessGain - Loudness gain to set, expressed in dB. - * The value type is float, form -90.0 to 24.0. + * 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}. + * This method uses a promise to return the result. + * @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 } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; @@ -8081,7 +8082,6 @@ declare namespace audio { * {@link StreamUsage#STREAM_USAGE_MOVIE} or * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. * @syscap SystemCapability.Multimedia.Audio.Renderer - * @crossplatform * @since 20 */ setLoudnessGain(loudnessGain: number): Promise; -- Gitee From 6386ac1c825506a7c34c21ba0daa567c7d4d5cd5 Mon Sep 17 00:00:00 2001 From: lizihao Date: Mon, 7 Apr 2025 11:38:55 +0800 Subject: [PATCH 6/6] fix comments Signed-off-by: lizihao --- api/@ohos.multimedia.audio.d.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index d81e65802f..9b66b1cd17 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8068,19 +8068,14 @@ declare namespace audio { * 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}. - * This method uses a promise to return the result. + * 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 } 401 - Parameter error. Possible causes: - * 1.Mandatory parameters are left unspecified; - * 2.Incorrect parameter types. * @throws { BusinessError } 6800101 - Parameter verification failed. - * @throws { BusinessError } 6800103 - Operation not permit at current state. - * e.g. the stream usage of the audio renderer is not - * {@link StreamUsage#STREAM_USAGE_MUSIC}, - * {@link StreamUsage#STREAM_USAGE_MOVIE} or - * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * @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}. * @syscap SystemCapability.Multimedia.Audio.Renderer * @since 20 */ -- Gitee