1 Star 0 Fork 4.9K

Cain / docs

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

AudioAttribute

Overview

Related Modules:

Audio

Description:

Provides attribute-related APIs for audio rendering or capturing, including functions to obtain frame information and set audio sampling attributes.

Since:

1.0

Version:

1.0

Summary

Data Fields

Variable Name

Description

GetFrameSize )(AudioHandle handle, uint64_t *size)

int32_t(* 

Obtains the audio frame size, that is, the length (in bytes) of a frame.

GetFrameCount )(AudioHandle handle, uint64_t *count)

int32_t(* 

Obtains the number of audio frames in the audio buffer.

SetSampleAttributes )(AudioHandle handle, const struct AudioSampleAttributes *attrs)

int32_t(* 

Sets audio sampling attributes.

GetSampleAttributes )(AudioHandle handle, struct AudioSampleAttributes *attrs)

int32_t(* 

Obtains audio sampling attributes.

GetCurrentChannelId )(AudioHandle handle, uint32_t *channelId)

int32_t(* 

Obtains the data channel ID of the audio.

Details

Field Documentation

GetCurrentChannelId

int32_t(* AudioAttribute::GetCurrentChannelId) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, uint32_t *channelId)

Description:

Obtains the data channel ID of the audio.

Parameters:

Name

Description

handle Indicates the audio handle.
channelId Indicates the pointer to the data channel ID.

Returns:

Returns 0 if the data channel ID is obtained; returns a negative value otherwise.

GetFrameCount

int32_t(* AudioAttribute::GetFrameCount) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, uint64_t *count)

Description:

Obtains the number of audio frames in the audio buffer.

Parameters:

Name

Description

handle Indicates the audio handle.
count Indicates the pointer to the number of audio frames in the audio buffer.

Returns:

Returns 0 if the number of audio frames is obtained; returns a negative value otherwise.

GetFrameSize

int32_t(* AudioAttribute::GetFrameSize) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, uint64_t *size)

Description:

Obtains the audio frame size, that is, the length (in bytes) of a frame.

Parameters:

Name

Description

handle Indicates the audio handle.
size Indicates the pointer to the audio frame size (in bytes).

Returns:

Returns 0 if the audio frame size is obtained; returns a negative value otherwise.

GetSampleAttributes

int32_t(* AudioAttribute::GetSampleAttributes) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, struct [AudioSampleAttributes](AudioSampleAttributes.md) *attrs)

Description:

Obtains audio sampling attributes.

Parameters:

Name

Description

handle Indicates the audio handle.
attrs Indicates the pointer to the audio sampling attributes, such as the sampling rate, sampling precision, and channel.

Returns:

Returns 0 if audio sampling attributes are obtained; returns a negative value otherwise.

See also:

SetSampleAttributes

SetSampleAttributes

int32_t(* AudioAttribute::SetSampleAttributes) ([AudioHandle](Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, const struct [AudioSampleAttributes](AudioSampleAttributes.md) *attrs)

Description:

Sets audio sampling attributes.

Parameters:

Name

Description

handle Indicates the audio handle.
attrs Indicates the pointer to the audio sampling attributes to set, such as the sampling rate, sampling precision, and channel.

Returns:

Returns 0 if the setting is successful; returns a negative value otherwise.

See also:

GetSampleAttributes

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

搜索帮助