diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index f5ec05467ebfeb5a60f52273680371ba8e24f7ed..6b2eb446cf1288fc9e33c47d11e948a4931254e7 100755 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -3015,6 +3015,27 @@ declare namespace media { */ setBitrate(bitrate: number): void; + /** + * Sets the loudness gain of current media. The default gain is 0.0 dB. + * This API can be called only when the AVPlayer is in the prepared, playing, paused completed or stopped state. + * The stream usage of audioRendererInfo must be {@link StreamUsage#STREAM_USAGE_MUSIC}, + * {@link StreamUsage#STREAM_USAGE_MOVIE}, or {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * After this API is called, the loudness gain takes effect immediately. + * @param { double } loudnessGain - Loudness gain to set, expressed in dB. The value is a + * floating int ranging from -90.0 dB to 24.0 dB. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 5400102 - Operation not allowed. Return by promise. + * e.g. The function is called in an incorrect state, or the stream usage of audioRendererInfo is not one of + * {@link StreamUsage#STREAM_USAGE_MUSIC}, {@link StreamUsage#STREAM_USAGE_MOVIE} or + * {@link StreamUsage#STREAM_USAGE_AUDIOBOOK}. + * @throws { BusinessError } 5400105 - Service died. + * @throws { BusinessError } 5400108 - Parameter check failed. Returned by promise. + * @syscap SystemCapability.Multimedia.Media.AVPlayer + * @since 21 + * @arkts 1.1&1.2 + */ + setLoudnessGain(loudnessGain: double): Promise; + /** * Set decryption session to codec module. * @param { drm.MediaKeySession } mediaKeySession - Handle of MediaKeySession to decrypt encrypted media.