import { BusinessError } from '@ohos.base';
audioVolumeGroupManager.getVolume(audio.AudioVolumeType.MEDIA, (err: BusinessError, value: number) => {
if (err) {
console.error(`Failed to obtain the volume. ${err}`);
return;
}
console.info('Callback invoked to indicate that the volume is obtained.');
});
可以使用以下代码获取手机当前音量: