AudioVolume
Overview
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
Summary
Data Fields
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) |
Details
Field Documentation
GetGain
int32_t(* AudioVolume::GetGain) ([AudioHandle]($api-api-SmartVision-Devices-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:
GetGainThreshold
int32_t(* AudioVolume::GetGainThreshold) ([AudioHandle]($api-api-SmartVision-Devices-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:
GetMute
int32_t(* AudioVolume::GetMute) ([AudioHandle]($api-api-SmartVision-Devices-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:
GetVolume
int32_t(* AudioVolume::GetVolume) ([AudioHandle]($api-api-SmartVision-Devices-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:
SetGain
int32_t(* AudioVolume::SetGain) ([AudioHandle]($api-api-SmartVision-Devices-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:
SetMute
int32_t(* AudioVolume::SetMute) ([AudioHandle]($api-api-SmartVision-Devices-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:
SetVolume
int32_t(* AudioVolume::SetVolume) ([AudioHandle]($api-api-SmartVision-Devices-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: