hi_mpi_ai_set_chn_attr

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

☓

Atlas A3 training products / Atlas A3 inference products

☓

Atlas A2 training products / Atlas A2 inference products

☓

Atlas 200I/500 A2 inference products

√

Atlas inference products

☓

Atlas training products

☓

Function

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 mode must be used. The resampling function can be enabled by calling hi_mpi_ai_enable_resample.
  • In the HI_AI_CHN_MODE_FAST mode, resampling is not supported, and an AI channel cannot be bound to an AENC channel. You can call hi_mpi_ai_get_frame to obtain audio data from an AI channel.

Returns

Reference

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