AudioAdapter

Overview

Related Modules:

Audio

Description:

Provides audio adapter capabilities, including initializing ports, creating rendering and capturing tasks, and obtaining the port capability set.

Since:

1.0

Version:

1.0

Summary

Data Fields

Variable Name

Description

InitAllPorts )(struct AudioAdapteradapter)

int32_t( 

Initializes all ports of an audio adapter.

CreateRender )(struct AudioAdapteradapter, const struct AudioDeviceDescriptordesc, const struct AudioSampleAttributesattrs, struct AudioRender **render)

int32_t( 

Creates an AudioRender object.

DestroyRender )(struct AudioAdapteradapter, struct AudioRenderrender)

int32_t( 

Destroys an AudioRender object.

CreateCapture )(struct AudioAdapter adapter, const struct AudioDeviceDescriptordesc, const struct AudioSampleAttributesattrs, struct AudioCapture*capture)

int32_t( 

Creates an AudioCapture object.

DestroyCapture )(struct AudioAdapteradapter, struct AudioCapturecapture)

int32_t( 

Destroys an AudioCapture object.

GetPortCapability )(struct AudioAdapter adapter, const struct AudioPortport, struct AudioPortCapabilitycapability)

int32_t( 

Obtains the capability set of the port driver for the audio adapter.

SetPassthroughMode )(struct AudioAdapter adapter, const struct AudioPortport, enum AudioPortPassthroughMode mode)

int32_t( 

Sets the passthrough data transmission mode of the audio port driver.

GetPassthroughMode )(struct AudioAdapteradapter, const struct AudioPortport, enum AudioPortPassthroughModemode)

int32_t( 

Obtains the passthrough data transmission mode of the audio port driver.

Details

Field Documentation

CreateCapture

  1. int32_t(*AudioAdapter::CreateCapture)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,conststruct[AudioDeviceDescriptor]($api-api-SmartVision-Devices-AudioDeviceDescriptor.md)*desc,conststruct[AudioSampleAttributes]($api-api-SmartVision-Devices-AudioSampleAttributes.md)*attrs,struct[AudioCapture]($api-api-SmartVision-Devices-AudioCapture.md)**capture)

Description:

Creates an AudioCapture object.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
descIndicates the pointer to the descriptor of the audio adapter to start.
attrsIndicates the pointer to the audio sampling attributes to open.
captureIndicates the double pointer to the AudioCapture object.

Returns:

Returns 0 if the AudioCapture object is created successfully; returns a negative value otherwise.

See also:

GetPortCapability

CreateRender

  1. int32_t(*AudioAdapter::CreateRender)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,conststruct[AudioDeviceDescriptor]($api-api-SmartVision-Devices-AudioDeviceDescriptor.md)*desc,conststruct[AudioSampleAttributes]($api-api-SmartVision-Devices-AudioSampleAttributes.md)*attrs,struct[AudioRender]($api-api-SmartVision-Devices-AudioRender.md)**render)

Description:

Creates an AudioRender object.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
descIndicates the pointer to the descriptor of the audio adapter to start.
attrsIndicates the pointer to the audio sampling attributes to open.
renderIndicates the double pointer to the AudioRender object.

Returns:

Returns 0 if the AudioRender object is created successfully; returns a negative value otherwise.

See also:

GetPortCapability

DestroyCapture

  1. int32_t(*AudioAdapter::DestroyCapture)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,struct[AudioCapture]($api-api-SmartVision-Devices-AudioCapture.md)*capture)

Description:

Destroys an AudioCapture object.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
captureIndicates the pointer to the AudioCapture object to operate.

Attention:

Do not destroy the object during audio capturing.

Returns:

Returns 0 if the AudioCapture object is destroyed; returns a negative value otherwise.

See also:

CreateCapture

DestroyRender

  1. int32_t(*AudioAdapter::DestroyRender)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,struct[AudioRender]($api-api-SmartVision-Devices-AudioRender.md)*render)

Description:

Destroys an AudioRender object.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
renderIndicates the pointer to the AudioRender object to operate.

Attention:

Do not destroy the object during audio rendering.

Returns:

Returns 0 if the AudioRender object is destroyed; returns a negative value otherwise.

See also:

CreateRender

GetPassthroughMode

  1. int32_t(*AudioAdapter::GetPassthroughMode)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,conststruct[AudioPort]($api-api-SmartVision-Devices-AudioPort.md)*port,enum[AudioPortPassthroughMode]($api-api-SmartVision-Devices-Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e) *mode)

Description:

Obtains the passthrough data transmission mode of the audio port driver.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
portIndicates the pointer to the port.
modeIndicates the pointer to the passthrough transmission mode to obtain.

Returns:

Returns 0 if the mode is successfully obtained; returns a negative value otherwise.

See also:

SetPassthroughMode

GetPortCapability

  1. int32_t(*AudioAdapter::GetPortCapability)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,conststruct[AudioPort]($api-api-SmartVision-Devices-AudioPort.md)*port,struct[AudioPortCapability]($api-api-SmartVision-Devices-AudioPortCapability.md)*capability)

Description:

Obtains the capability set of the port driver for the audio adapter.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
portIndicates the pointer to the port.
capabilityIndicates the pointer to the capability set to obtain.

Returns:

Returns 0 if the capability set is successfully obtained; returns a negative value otherwise.

InitAllPorts

  1. int32_t(*AudioAdapter::InitAllPorts)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter)

Description:

Initializes all ports of an audio adapter.

Call this function before calling other driver functions to check whether the initialization is complete. If the initialization is not complete, wait for a while (for example, 100 ms) and perform the check again until the port initialization is complete.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.

Returns:

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

SetPassthroughMode

  1. int32_t(*AudioAdapter::SetPassthroughMode)(struct[AudioAdapter]($api-api-SmartVision-Devices-AudioAdapter.md)*adapter,conststruct[AudioPort]($api-api-SmartVision-Devices-AudioPort.md)*port,enum[AudioPortPassthroughMode]($api-api-SmartVision-Devices-Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e) mode)

Description:

Sets the passthrough data transmission mode of the audio port driver.

Parameters:

Name

Description

adapterIndicates the pointer to the audio adapter to operate.
portIndicates the pointer to the port.
modeIndicates the passthrough transmission mode to set.

Returns:

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

See also:

GetPassthroughMode