同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Related Modules:
Description:
Provides volume-related APIs for audio rendering or capturing, including functions to set the mute operation, volume, and gain.
Since:
1.0
Version:
1.0
SetMute )(AudioHandle handle, bool mute) |
|
GetMute )(AudioHandle handle, bool *mute) |
|
SetVolume )(AudioHandle handle, float volume) |
|
GetVolume )(AudioHandle handle, float *volume) |
|
GetGainThreshold )(AudioHandle handle, float *min, float *max) |
|
GetGain )(AudioHandle handle, float *gain) |
|
SetGain )(AudioHandle handle, float gain) |
int32_t(* AudioVolume::GetGain) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float *gain)
Description:
Obtains the audio gain.
Parameters:
handle | Indicates the audio handle. |
gain | Indicates the pointer to the audio gain. |
Returns:
Returns 0 if the audio gain is obtained; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::GetGainThreshold) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float *min, float *max)
Description:
Obtains the range of the audio gain.
The audio gain can be expressed in one of the following two ways (depending on the chip platform), corresponding to two types of value ranges:
Parameters:
handle | Indicates the audio handle. |
min | Indicates the pointer to the minimum value of the range. |
max | Indicates the pointer to the maximum value of the range. |
Returns:
Returns 0 if the range is obtained; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::GetMute) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, bool *mute)
Description:
Obtains the mute operation set for the audio.
Parameters:
handle | Indicates the audio handle. |
mute | Indicates the pointer to the mute operation set for the audio. Value true means that the audio is muted, and false means the opposite. |
Returns:
Returns 0 if the mute operation is obtained; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::GetVolume) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float *volume)
Description:
Obtains the audio volume.
Parameters:
handle | Indicates the audio handle. |
volume | Indicates the pointer to the volume to obtain. The value ranges from 0.0 to 1.0. |
Returns:
Returns 0 if the volume is obtained; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::SetGain) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float gain)
Description:
Sets the audio gain.
Parameters:
handle | Indicates the audio handle. |
gain | Indicates the audio gain to set. |
Returns:
Returns 0 if the setting is successful; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::SetMute) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, bool mute)
Description:
Sets the mute operation for the audio.
Parameters:
handle | Indicates the audio handle. |
mute | Specifies whether to mute the audio. Value true means to mute the audio, and false means the opposite. |
Returns:
Returns 0 if the setting is successful; returns a negative value otherwise.
See also:
int32_t(* AudioVolume::SetVolume) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float volume)
Description:
Sets the audio volume.
The volume ranges from 0.0 to 1.0. If the volume level in an audio service ranges from 0 to 15, 0.0 indicates that the audio is muted, and 1.0 indicates the maximum volume level (15).
Parameters:
handle | Indicates the audio handle. |
volume | Indicates the volume to set. The value ranges from 0.0 to 1.0. |
Returns:
Returns 0 if the setting is successful; returns a negative value otherwise.
See also:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。