hi_mpi_ai_set_chn_attr

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Description

Sets the attributes of an AI channel.

Prototype

hi_s32 hi_mpi_ai_set_chn_attr(hi_audio_dev ai_dev, hi_ai_chn ai_chn, const hi_ai_chn_attr *chn_attr)

Parameters

Parameter

Input/Output

Description

ai_dev

Input

Audio device ID. The value range is [0, 2].

In the network video recorder (NVR) scenario, only dev2 is involved.

ai_chn

Input

AI channel ID.

Only the mono audio channel is supported. The value of ai_chn is fixed at 0.

chn_attr

Input

Pointer to the structure of audio channel attributes.

  • The channel attribute structure has only one member variable, which is used to set the working mode of the channel. The default working mode is HI_AI_CHN_MODE_FAST.
  • In the network video recorder (NVR) scenario, the HI_AI_CHN_MODE_NORMAL standard mode needs to be used, and the hi_mpi_ai_enable_resample interface can be called to enable the resampling function.
  • In HI_AI_CHN_MODE_FAST mode, resampling is not supported, and the AI channel cannot be bound to the AENC channel. You need to call the hi_mpi_ai_get_frame API to obtain the audio data obtained by using the AI channel.

Returns

See Also

For the API call sequence, see Voice Intercom (NVR Scenario).