1 Star 0 Fork 4.9K

famoustang / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
AudioVolume.md 16.49 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

AudioVolume

Overview

Related Modules:

Audio

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

Variable Name

Description

SetMute )(AudioHandle handle, bool mute)

int32_t(* 

Sets the mute operation for the audio.

GetMute )(AudioHandle handle, bool *mute)

int32_t(* 

Obtains the mute operation set for the audio.

SetVolume )(AudioHandle handle, float volume)

int32_t(* 

Sets the audio volume.

GetVolume )(AudioHandle handle, float *volume)

int32_t(* 

Obtains the audio volume.

GetGainThreshold )(AudioHandle handle, float *min, float *max)

int32_t(* 

Obtains the range of the audio gain.

GetGain )(AudioHandle handle, float *gain)

int32_t(* 

Obtains the audio gain.

SetGain )(AudioHandle handle, float gain)

int32_t(* 

Sets the audio gain.

Details

Field Documentation

GetGain

int32_t(* AudioVolume::GetGain) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float *gain)

Description:

Obtains the audio gain.

Parameters:

Name

Description

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

GetGainThreshold

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:

Name

Description

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:

GetGain

GetMute

int32_t(* AudioVolume::GetMute) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, bool *mute)

Description:

Obtains the mute operation set for the audio.

Parameters:

Name

Description

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:

SetMute

GetVolume

int32_t(* AudioVolume::GetVolume) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float *volume)

Description:

Obtains the audio volume.

Parameters:

Name

Description

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:

SetVolume

SetGain

int32_t(* AudioVolume::SetGain) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, float gain)

Description:

Sets the audio gain.

Parameters:

Name

Description

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:

GetGainThreshold

SetMute

int32_t(* AudioVolume::SetMute) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, bool mute)

Description:

Sets the mute operation for the audio.

Parameters:

Name

Description

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:

GetMute

SetVolume

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:

Name

Description

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:

GetVolume

1
https://gitee.com/famoustang/docs.git
git@gitee.com:famoustang/docs.git
famoustang
docs
docs
master

搜索帮助