hi_mpi_ao_enable_resample

Applicability

Product

Supported

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

Description

Enables AO resampling.

Prototype

hi_s32 hi_mpi_ao_enable_resample(hi_audio_dev ao_dev, hi_ao_chn ao_chn, hi_audio_sample_rate in_sample_rate)

Parameters

Parameter

Input/Output

Description

ao_dev

Input

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

In the network video recorder (NVR) scenario, only dev2 and dev3 are involved.

ao_chn

Input

AO channel ID. Only the mono audio channel (audio-left channel) is supported. The value of ao_chn is fixed at 0.

in_sample_rate

Input

Input sampling rate for audio resampling. Only 8 kHz is supported.

Returns

Restrictions

  • After enabling an AO channel by calling hi_mpi_ao_enable_chn and before binding the ADEC channel to the AO channel by calling hi_mpi_sys_bind, call this API to enable resampling.
  • After an AO channel is disabled by calling hi_mpi_ao_disable_chn, if you want to enable the AO channel again and use the resampling function, you need to call this API to enable resampling again.
  • The input sampling rate for AO resampling must be different from that specified in AO device attributes.
  • Due to the limitation of the Nyquist sampling theorem, when the audio sampling rate is 8 kHz, the supported audio frequency is less than 4 kHz.
  • The AO sampling rate is fixed at 48 kHz. The G.711a and G.711u protocols only support the sampling rate of 8 kHz, and when either protocol is used, resampling needs to be enabled. However, the AAC protocol supports the sampling rate of 48 kHz, and when it is used, AO resampling is not required.

See Also

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