diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 62ec8b3b16e9eacd53d7c16127c612d54bbc8f19..9db2d58bae3f933833d0ab26748c287a1a9c5199 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -4688,6 +4688,38 @@ declare namespace audio { */ setAppVolumePercentage(volume: number): Promise; + /** + * Sets the volume for a stream. This method uses a promise to return the result. + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } volume - Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @param { number } callingUid - Uid of the stream owner. + * @returns { Promise } Promise used to return the result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @throws { BusinessError } 6800301 - Crash or blocking occurs in system process. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 20 + */ + setSystemVolumeForUid(volumeType: AudioVolumeType, volume: number, callingUid: number): Promise; + + /** + * Obtains the volume of a stream. + * @param { AudioVolumeType } volumeType - Audio stream type. + * @param { number } callingUid - Uid of the stream owner. + * @returns { number } Current system volume level. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @throws { BusinessError } 6800101 - Parameter verification failed. + * @throws { BusinessError } 6800301 - Crash or blocking occurs in system process. + * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + * @since 20 + */ + getSystemVolumeForUid(volumeType: AudioVolumeType, callingUid: number): number; + /** * Listens for system volume change events. This method uses a callback to get volume change events. * @param { 'volumeChange' } type - Type of the event to listen for. Only the volumeChange event is supported.