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 AudioSampleAttributesattrs)

int32_t( 

Sets audio sampling attributes.

GetSampleAttributes )(AudioHandle handle, struct AudioSampleAttributesattrs)

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

  1. int32_t(*AudioAttribute::GetCurrentChannelId)([AudioHandle]($api-api-SmartVision-Devices-Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, uint32_t *channelId)

Description:

Obtains the data channel ID of the audio.

Parameters:

Name

Description

handleIndicates the audio handle.
channelIdIndicates the pointer to the data channel ID.

Returns:

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

GetFrameCount

  1. int32_t(*AudioAttribute::GetFrameCount)([AudioHandle]($api-api-SmartVision-Devices-Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, uint64_t *count)

Description:

Obtains the number of audio frames in the audio buffer.

Parameters:

Name

Description

handleIndicates the audio handle.
countIndicates 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

  1. int32_t(*AudioAttribute::GetFrameSize)([AudioHandle]($api-api-SmartVision-Devices-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

handleIndicates the audio handle.
sizeIndicates 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

  1. int32_t(*AudioAttribute::GetSampleAttributes)([AudioHandle]($api-api-SmartVision-Devices-Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, struct [AudioSampleAttributes]($api-api-SmartVision-Devices-AudioSampleAttributes.md) *attrs)

Description:

Obtains audio sampling attributes.

Parameters:

Name

Description

handleIndicates the audio handle.
attrsIndicates 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

  1. int32_t(*AudioAttribute::SetSampleAttributes)([AudioHandle]($api-api-SmartVision-Devices-Audio.md#ga18675ddb073465fdeac33a897f675d79) handle, const struct [AudioSampleAttributes]($api-api-SmartVision-Devices-AudioSampleAttributes.md) *attrs)

Description:

Sets audio sampling attributes.

Parameters:

Name

Description

handleIndicates the audio handle.
attrsIndicates 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