diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 62ec8b3b16e9eacd53d7c16127c612d54bbc8f19..9b66b1cd1778a1b305bfa24b5e85406daef820d9 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -8064,6 +8064,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}. + * @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.