Audio

    Since:

    1.0

    Version:

    1.0

    Summary

    Files

    Data Structures

    Data Structure Name

    Description

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

    AudioAttribute

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

    Provides capabilities for audio capturing, including controlling the capturing, setting audio attributes, scenes, and volume, and capturing audio frames.

    AudioControl

    Provides control-related APIs for audio rendering or capturing, including functions to start, stop, pause, and resume audio rendering or capturing, and flush data in the audio buffer.

    Manages audio adapters through a specific adapter driver program loaded based on the given audio adapter descriptor.

    AudioRender

    Provides capabilities for audio rendering, including controlling the rendering, setting audio attributes, scenes, and volume, obtaining hardware latency, and rendering audio frames.

    Provides scene-related APIs for audio rendering or capturing, including functions to select an audio scene and check whether the configuration of an audio scene is supported.

    AudioPort

    Defines the audio port.

    Defines the audio adapter descriptor.

    AudioDeviceDescriptor

    Defines the audio device descriptor.

    Defines the audio scene descriptor.

    AudioSceneDescriptor::SceneDesc

    Describes the audio scene.

    Defines audio sampling attributes.

    AudioTimeStamp

    Defines the audio timestamp, which is a substitute for POSIX timespec.

    Defines the sub-port capability.

    AudioPortCapability

    Defines the audio port capability.

    Provides volume-related APIs for audio rendering or capturing, including functions to set the mute operation, volume, and gain.

    Typedefs

    Typedef Name

    Description

    AudioHandle

    typedef void * 

    Defines the audio handle.

    Enumerations

    Enumeration Name

    Description

    AudioPortDirection { = 0x1u, PORT_IN = 0x2u, = 0x3u }

    Enumerates the audio port type.

    AudioPortPin {    = 0x0u, PIN_OUT_SPEAKER = 0x1u, = 0x2u, PIN_OUT_LINEOUT = 0x4u,    = 0x8u, PIN_IN_MIC = 0x8000001u, = 0x8000002u, PIN_IN_LINEIN = 0x8000004u }

    Enumerates the pin of an audio adapter.

    { AUDIO_IN_MEDIA = 0, }

    Enumerates the audio category.

    AudioFormat {    = 0x1u, AUDIO_FORMAT_PCM_16_BIT = 0x2u, = 0x3u, AUDIO_FORMAT_PCM_32_BIT = 0x4u,    = 0x1000001u, AUDIO_FORMAT_AAC_LC = 0x1000002u, = 0x1000003u, AUDIO_FORMAT_AAC_ELD = 0x1000004u,    = 0x1000005u, AUDIO_FORMAT_AAC_HE_V2 = 0x1000006u }

    Enumerates the audio format.

    { AUDIO_CHANNEL_FRONT_LEFT = 0x1, = 0x2, AUDIO_CHANNEL_MONO = 0x1u, = 0x3u }

    Enumerates the audio channel mask.

    AudioSampleRatesMask {    = 0x1u, AUDIO_SAMPLE_RATE_MASK_12000 = 0x2u, = 0x4u, AUDIO_SAMPLE_RATE_MASK_16000 = 0x8u,    = 0x10u, AUDIO_SAMPLE_RATE_MASK_24000 = 0x20u, = 0x40u, AUDIO_SAMPLE_RATE_MASK_44100 = 0x80u,    = 0x100u, AUDIO_SAMPLE_RATE_MASK_64000 = 0x200u, = 0x400u, AUDIO_SAMPLE_RATE_MASK_INVALID = 0xFFFFFFFFu }

    Enumerates masks of audio sampling rates.

    { PORT_PASSTHROUGH_LPCM = 0x1, = 0x2, PORT_PASSTHROUGH_HBR2LBR = 0x4, = 0x8 }

    Enumerates the passthrough data transmission mode of an audio port.

    Enumerates channel modes for audio rendering.

    Functions

    Details

    Enumeration Type Documentation

    AudioCategory

    Description:

    Enumerates the audio category.

    Enumerator

    Description

    AUDIO_IN_MEDIA 

    Media

    AUDIO_IN_COMMUNICATION 

    Communications

    AudioChannelMask

    Description:

    Enumerates the audio channel mask.

    A mask describes an audio channel position.

    Enumerator

    Description

    AUDIO_CHANNEL_FRONT_LEFT 

    Front left channel

    AUDIO_CHANNEL_FRONT_RIGHT 

    Front right channel

    AUDIO_CHANNEL_MONO 

    Mono channel

    AUDIO_CHANNEL_STEREO 

    Stereo channel, consisting of front left and front right channels

    AudioChannelMode

    1. enum [AudioChannelMode]($api-api-SmartVision-Devices-Audio.md#ga78aab1fafb9657451804e42b42897123)

    Description:

    Enumerates channel modes for audio rendering.

    Attention:

    The following modes are set for rendering dual-channel audios. Others are not supported.

    Enumerator

    Description

    AUDIO_CHANNEL_NORMAL 

    Normal mode. No processing is required.

    AUDIO_CHANNEL_BOTH_LEFT 

    Two left channels

    AUDIO_CHANNEL_BOTH_RIGHT 

    Two right channels

    AUDIO_CHANNEL_EXCHANGE 

    Data exchange between the left and right channels. The left channel takes the audio stream of the right channel, and the right channel takes that of the left channel.

    AUDIO_CHANNEL_MIX 

    Mix of streams of the left and right channels

    AUDIO_CHANNEL_LEFT_MUTE 

    Left channel muted. The stream of the right channel is output.

    AUDIO_CHANNEL_RIGHT_MUTE 

    Right channel muted. The stream of the left channel is output.

    AUDIO_CHANNEL_BOTH_MUTE 

    Both left and right channels muted

    AudioFormat

    1. enum [AudioFormat]($api-api-SmartVision-Devices-Audio.md#ga98d5d077cca088ddf77314871474fe59)

    Description:

    Enumerates the audio format.

    AudioPortDirection

    1. enum [AudioPortDirection]($api-api-SmartVision-Devices-Audio.md#ga68ff7140b15790debbac4bbc62f8e9f8)

    Description:

    Enumerates the audio port type.

    Enumerator

    Description

    PORT_OUT 

    Output port

    PORT_IN 

    Input port

    PORT_OUT_IN 

    Input/output port, supporting both audio input and output

    AudioPortPassthroughMode

    1. enum [AudioPortPassthroughMode]($api-api-SmartVision-Devices-Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e)

    Description:

    Enumerates the passthrough data transmission mode of an audio port.

    Enumerator

    Description

    PORT_PASSTHROUGH_LPCM 

    Stereo PCM

    PORT_PASSTHROUGH_RAW 

    HDMI passthrough

    PORT_PASSTHROUGH_HBR2LBR 

    Blu-ray next-generation audio output with reduced specifications

    PORT_PASSTHROUGH_AUTO 

    Mode automatically matched based on the HDMI EDID

    AudioPortPin

    1. enum [AudioPortPin]($api-api-SmartVision-Devices-Audio.md#gaa7114aeeccf3ac4f5f7e1d880bcfa835)

    Description:

    Enumerates the pin of an audio adapter.

    Enumerator

    Description

    PIN_NONE 

    Invalid pin

    PIN_OUT_SPEAKER 

    Speaker output pin

    PIN_OUT_HEADSET 

    Wired headset pin for output

    PIN_OUT_LINEOUT 

    Line-out pin

    PIN_OUT_HDMI 

    HDMI output pin

    PIN_IN_MIC 

    Microphone input pin

    PIN_IN_HS_MIC 

    Wired headset microphone pin for input

    PIN_IN_LINEIN 

    Line-in pin

    AudioSampleRatesMask

    1. enum [AudioSampleRatesMask]($api-api-SmartVision-Devices-Audio.md#ga7053fcaa56d1dc47d2fcd83ee131fe4c)

    Description:

    GetAudioManagerFuncs()

    1. struct [AudioManager]($api-api-SmartVision-Devices-AudioManager.md)* GetAudioManagerFuncs (void )

    Description:

    Obtains the operation function list of the class.

    Returns:

    Returns the pointer to the AudioManager object if the list is obtained; returns NULL otherwise.

    Variable Documentation

    adapterName

      Description:

      Name of the audio adapter

      channelCount [1/2]

      1. uint32_t AudioSampleAttributes::channelCount

      Description:

      Number of audio channels. For example, for the mono channel, the value is 1, and for the stereo channel, the value is 2.

      channelCount [2/2]

      1. uint32_t AudioPortCapability::channelCount

      Description:

      Supported maximum number of audio channels

      channelMasks

      1. enum [AudioChannelMask]($api-api-SmartVision-Devices-Audio.md#ga137eb03027d5947ea294b32f5095b83c) AudioPortCapability::channelMasks

      Description:

      Audio channel layout mask of the device. For details, see AudioChannelMask.

      desc [1/4]

      1. const char* AudioDeviceDescriptor::desc

      Description:

      Audio device name

      desc [2/4]

      Description:

      Audio device descriptor

      desc [3/4]

      Description:

      Name of the audio scene

      desc [4/4]

      1. const char* AudioSubPortCapability::desc

      Description:

      Sub-port name

      deviceId

      1. uint32_t AudioPortCapability::deviceId

      Description:

      Device ID used for device binding

      deviceType

      1. uint32_t AudioPortCapability::deviceType

      Description:

      Device type (output or input)

      dir

      1. enum [AudioPortDirection]($api-api-SmartVision-Devices-Audio.md#ga68ff7140b15790debbac4bbc62f8e9f8) AudioPort::dir

      Description:

      Audio port type. For details, see AudioPortDirection

      format

      1. enum [AudioFormat]($api-api-SmartVision-Devices-Audio.md#ga98d5d077cca088ddf77314871474fe59) AudioSampleAttributes::format

      Description:

      Audio data format. For details, see AudioFormat.

      formatNum

      1. uint32_t AudioPortCapability::formatNum

      Description:

      Number of the supported audio formats

      formats

      1. enum [AudioFormat]($api-api-SmartVision-Devices-Audio.md#ga98d5d077cca088ddf77314871474fe59)* AudioPortCapability::formats

      Description:

      Supported audio formats. For details, see .

      1. bool AudioPortCapability::hardwareMode

      Description:

      Whether to support device binding

      id

      1. uint32_t AudioSceneDescriptor::SceneDesc::id

      Description:

      Audio scene ID

      interleaved

      1. bool AudioSampleAttributes::interleaved

      Description:

      Interleaving flag of audio data

      mask

      1. enum [AudioPortPassthroughMode]($api-api-SmartVision-Devices-Audio.md#ga186d2d4f9a2ecacb80cd2cce2bd26f0e) AudioSubPortCapability::mask

      Description:

      Passthrough mode of data transmission. For details, see .

      pins

      1. enum [AudioPortPin]($api-api-SmartVision-Devices-Audio.md#gaa7114aeeccf3ac4f5f7e1d880bcfa835) AudioDeviceDescriptor::pins

      Description:

      Pins of audio ports (input and output). For details, see .

      portId [1/3]

      Description:

      Audio port ID

      portId [2/3]

      Description:

      Audio port ID

      portId [3/3]

      1. uint32_t AudioSubPortCapability::portId

      Description:

      Sub-port ID

      portName

      1. const char* AudioPort::portName

      Description:

      Audio port name

      portNum

      1. uint32_t AudioAdapterDescriptor::portNum

      Description:

      Number of ports supported by an audio adapter

      ports

      1. struct [AudioPort]($api-api-SmartVision-Devices-AudioPort.md)* AudioAdapterDescriptor::ports

      Description:

      List of ports supported by an audio adapter

      sampleRate

      1. uint32_t AudioSampleAttributes::sampleRate

      Description:

      Audio sampling rate

      sampleRateMasks

      1. uint32_t AudioPortCapability::sampleRateMasks

      Description:

      Supported audio sampling rates (8 kHz, 16 kHz, 32 kHz, and 48 kHz)

      scene

      1. union [AudioSceneDescriptor::SceneDesc]($api-api-SmartVision-Devices-AudioSceneDescriptor-SceneDesc.md) AudioSceneDescriptor::scene

      Description:

      The scene object

      subPorts

      1. struct [AudioSubPortCapability]($api-api-SmartVision-Devices-AudioSubPortCapability.md)* AudioPortCapability::subPorts

      Description:

      List of supported sub-ports

      subPortsNum

      1. uint32_t AudioPortCapability::subPortsNum

      Description:

      Number of supported sub-ports (for output devices only)

      tvNSec

      1. int64_t AudioTimeStamp::tvNSec

      Description:

      Nanoseconds

      1. int64_t AudioTimeStamp::tvSec

      Description:

      Seconds

      type

      1. enum [AudioCategory]($api-api-SmartVision-Devices-Audio.md#gaf210d41d152890f3aaf2aaac99bd28d5) AudioSampleAttributes::type

      Description:

      Audio type. For details, see