hi_mpi_ao_enable_resample
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
☓ |
|
|
☓ |
|
|
☓ |
|
|
√ |
|
|
☓ |
|
|
☓ |
Function 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
- 0: success
- Other values: failure. For details, see Audio Return Codes.
Restrictions
- Call this API to enable the resampling function after the AO channel is enabled by calling the hi_mpi_ao_enable_chn API and before the ADEC is bound to the AO by calling the hi_mpi_sys_bind API.
- 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.