hi_mpi_ao_enable_resample

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Description

Enables AO resampling.

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.

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