ISVP-SDK
3.12.0
Ingenic Smart Video Platform SDK
|
audio module, including audio record and playback, audio encoding and decoding, volume and gain setting, (audio) echo cancellation, automatic gain function and so on More...
Data Structures | |
struct | IMPAudioIOAttr |
Audio input and output device attribute. More... | |
struct | IMPAudioFrame |
Audio frame structure. More... | |
struct | IMPAudioIChnParam |
Audio channel parameter structure. More... | |
struct | IMPAudioOChnState |
Data cache state structure of audio output channel. More... | |
struct | IMPAudioStream |
Define audio stream structure. More... | |
struct | IMPAudioEncChnAttr |
Define audio encoding channel attribute structure. More... | |
struct | IMPAudioEncEncoder |
Define the encoder attribute structure. More... | |
struct | IMPAudioDecChnAttr |
Define the decoded channel attribute structure. More... | |
struct | IMPAudioDecDecoder |
Define decoder attribute structure. More... | |
struct | IMPAudioAgcConfig |
Define AGC gain structure. More... | |
Macros | |
#define | MAX_AUDIO_FRAME_NUM 50 |
Maximum number of audio frames. | |
Enumerations | |
enum | IMPBlock { BLOCK = 0, NOBLOCK = 1 } |
Audio stream blocking type. More... | |
enum | IMPAudioSampleRate { AUDIO_SAMPLE_RATE_8000 = 8000, AUDIO_SAMPLE_RATE_16000 = 16000, AUDIO_SAMPLE_RATE_24000 = 24000, AUDIO_SAMPLE_RATE_44100 = 44100, AUDIO_SAMPLE_RATE_48000 = 48000, AUDIO_SAMPLE_RATE_96000 = 96000 } |
Audio sampling rate definition. More... | |
enum | IMPAudioBitWidth { AUDIO_BIT_WIDTH_16 = 16 } |
Audio sampling precision definition. More... | |
enum | IMPAudioSoundMode { AUDIO_SOUND_MODE_MONO = 1, AUDIO_SOUND_MODE_STEREO = 2 } |
Audio channel mode definition. More... | |
enum | IMPAudioPalyloadType { PT_PCM = 0, PT_G711A = 1, PT_G711U = 2, PT_G726 = 3, PT_AEC = 4, PT_ADPCM = 5, PT_MAX = 6 } |
Define audio payload type enumeration. | |
enum | IMPAudioDecMode { ADEC_MODE_PACK = 0, ADEC_MODE_STREAM = 1 } |
Define the decoding method. More... | |
enum | Level_ns { NS_LOW, NS_MODERATE, NS_HIGH, NS_VERYHIGH } |
Defines level of noise suppression. More... | |
Functions | |
int | IMP_AI_SetPubAttr (int audioDevId, IMPAudioIOAttr *attr) |
Set audio input device attribute. More... | |
int | IMP_AI_GetPubAttr (int audioDevId, IMPAudioIOAttr *attr) |
Get the attribute of the audio input device. More... | |
int | IMP_AI_Enable (int audioDevId) |
Enable audio input device. More... | |
int | IMP_AI_Disable (int audioDevId) |
Disable audio input device. More... | |
int | IMP_AI_EnableChn (int audioDevId, int aiChn) |
Enable audio input channel. More... | |
int | IMP_AI_DisableChn (int audioDevId, int aiChn) |
Disable audio input channel. More... | |
int | IMP_AI_PollingFrame (int audioDevId, int aiChn, unsigned int timeout_ms) |
Polling audio stream cache. More... | |
int | IMP_AI_GetFrame (int audioDevId, int aiChn, IMPAudioFrame *frm, IMPBlock block) |
Get audio frame. More... | |
int | IMP_AI_ReleaseFrame (int audioDevId, int aiChn, IMPAudioFrame *frm) |
Release audio frame. More... | |
int | IMP_AI_SetChnParam (int audioDevId, int aiChn, IMPAudioIChnParam *chnParam) |
Set audio input channel parameters. More... | |
int | IMP_AI_GetChnParam (int audioDevId, int aiChn, IMPAudioIChnParam *chnParam) |
Set audio input channel parameters. More... | |
int | IMP_AI_EnableAec (int aiDevId, int aiChn, int aoDevId, int aoChn) |
Enable audio echo cancellation feature of the specified audio input and audio output. More... | |
int | IMP_AI_DisableAec (int aiDevId, int aiChn) |
Disable audio echo cancellation feature. More... | |
int | IMP_AI_EnableNs (IMPAudioIOAttr *attr, int mode) |
Enable specified audio input noise suppression. More... | |
int | IMP_AI_DisableNs (void) |
Disable noise suppression. More... | |
int | IMP_AI_EnableAgc (IMPAudioIOAttr *attr, IMPAudioAgcConfig agcConfig) |
Enable automatic gain of audio input. More... | |
int | IMP_AI_DisableAgc (void) |
Disable AI automatic gain feature. More... | |
int | IMP_AO_EnableAgc (IMPAudioIOAttr *attr, IMPAudioAgcConfig agcConfig) |
Enable audio output automatic gain feature. More... | |
int | IMP_AO_DisableAgc (void) |
Disable AO automatic gain feature. More... | |
int | IMP_AI_EnableHpf (IMPAudioIOAttr *attr) |
Enable audio input for high pass filtering. More... | |
int | IMP_AI_DisableHpf (void) |
Disable AI high pass filtering function. More... | |
int | IMP_AO_EnableHpf (IMPAudioIOAttr *attr) |
Enable audio output for high pass filtering. More... | |
int | IMP_AO_DisableHpf (void) |
Disable AO high pass filtering function. More... | |
int | IMP_AO_SetPubAttr (int audioDevId, IMPAudioIOAttr *attr) |
Set audio input and output device attribute. More... | |
int | IMP_AO_GetPubAttr (int audioDevId, IMPAudioIOAttr *attr) |
Get audio input and output device attribute. More... | |
int | IMP_AO_Enable (int audioDevId) |
Enable audio output device. More... | |
int | IMP_AO_Disable (int audioDevId) |
Disable audio output device. More... | |
int | IMP_AO_EnableChn (int audioDevId, int aoChn) |
Enable audio output channel. More... | |
int | IMP_AO_DisableChn (int audioDevId, int aoChn) |
Disable audio output channel. More... | |
int | IMP_AO_SendFrame (int audioDevId, int aoChn, IMPAudioFrame *data, IMPBlock block) |
Send audio output frame. More... | |
int | IMP_AO_PauseChn (int audioDevId, int aoChn) |
Pause audio output channel. More... | |
int | IMP_AO_ResumeChn (int audioDevId, int aoChn) |
Resume audio output channel. More... | |
int | IMP_AO_ClearChnBuf (int audioDevId, int aoChn) |
Clear the current audio data cache in the audio output channel. More... | |
int | IMP_AO_QueryChnStat (int audioDevId, int aoChn, IMPAudioOChnState *status) |
Query the current audio data cache status in the audio output channel. More... | |
int | IMP_AENC_CreateChn (int aeChn, IMPAudioEncChnAttr *attr) |
Create audio encode channel. More... | |
int | IMP_AENC_DestroyChn (int aeChn) |
Destory audio encode channel. More... | |
int | IMP_AENC_SendFrame (int aeChn, IMPAudioFrame *frm) |
Send audio encoding audio frame. More... | |
int | IMP_AENC_PollingStream (int AeChn, unsigned int timeout_ms) |
Polling encoded audio stream cache. More... | |
int | IMP_AENC_GetStream (int aeChn, IMPAudioStream *stream, IMPBlock block) |
Get the encoded stream. More... | |
int | IMP_AENC_ReleaseStream (int aeChn, IMPAudioStream *stream) |
Releases the stream from the audio encoding channel. More... | |
int | IMP_AENC_RegisterEncoder (int *handle, IMPAudioEncEncoder *encoder) |
Register encoder. More... | |
int | IMP_AENC_ReleaseEncoder (int *handle) |
Release encoder. More... | |
int | IMP_ADEC_CreateChn (int adChn, IMPAudioDecChnAttr *attr) |
Create audio decode channel. More... | |
int | IMP_ADEC_DestroyChn (int adChn) |
Destory audio decoding channel. More... | |
int | IMP_ADEC_SendStream (int adChn, IMPAudioStream *stream, IMPBlock block) |
Send audio stream to audio decoding channel. More... | |
int | IMP_ADEC_PollingStream (int AdChn, unsigned int timeout_ms) |
Polling decode audio stream cache. More... | |
int | IMP_ADEC_GetStream (int adChn, IMPAudioStream *stream, IMPBlock block) |
Get the decoded stream. More... | |
int | IMP_ADEC_ReleaseStream (int adChn, IMPAudioStream *stream) |
Release of the stream from the audio decoding channel. More... | |
int | IMP_ADEC_ClearChnBuf (int adChn) |
Clears the current audio data cache in the audio decode channel. More... | |
int | IMP_ADEC_RegisterDecoder (int *handle, IMPAudioDecDecoder *decoder) |
Register decoder. More... | |
int | IMP_ADEC_ReleaseDecoder (int *handle) |
Unregister Decoder. More... | |
int | IMP_AI_SetVol (int audioDevId, int aiChn, int aiVol) |
ACODEC configuration. More... | |
int | IMP_AI_GetVol (int audioDevId, int aiChn, int *vol) |
Get the volume of the audio input. More... | |
int | IMP_AI_SetVolMute (int audioDevId, int aiChn, int mute) |
Set audio input mute. More... | |
int | IMP_AO_SetVol (int audioDevId, int aoChn, int aoVol) |
Set audio output channel volume. More... | |
int | IMP_AO_GetVol (int audioDevId, int aoChn, int *vol) |
Get audio output channel volume. More... | |
int | IMP_AO_SetVolMute (int audioDevId, int aoChn, int mute) |
Set audio output mute. More... | |
int | IMP_AI_SetGain (int audioDevId, int aiChn, int aiGain) |
Set audio input gain. More... | |
int | IMP_AI_GetGain (int audioDevId, int aiChn, int *aiGain) |
Get AI gain value. More... | |
int | IMP_AO_SetGain (int audioDevId, int aoChn, int aoGain) |
Set audio output gain. More... | |
int | IMP_AO_GetGain (int audioDevId, int aoChn, int *aoGain) |
Get audio output gain. More... | |
int | IMP_AO_Soft_Mute (int audioDevId, int aoChn) |
Output soft mute control. More... | |
int | IMP_AO_Soft_UNMute (int audioDevId, int aoChn) |
Output soft unmute control. More... | |
int | IMP_AI_GetFrameAndRef (int audioDevId, int aiChn, IMPAudioFrame *frm, IMPAudioFrame *ref, IMPBlock block) |
Get audio frame and output reference frame. More... | |
int | IMP_AI_EnableAecRefFrame (int audioDevId, int aiChn, int audioAoDevId, int aoChn) |
Open access reference frame. More... | |
int | IMP_AI_DisableAecRefFrame (int audioDevId, int aiChn, int audioAoDevId, int aoChn) |
Close access to the reference frame. More... | |
int | IMP_AO_CacheSwitch (int audioDevId, int aoChn, int cache_en) |
close audio play cache More... | |
int | IMP_AO_FlushChnBuf (int audioDevId, int aoChn) |
Variables | |
IMPAudioSampleRate | samplerate |
Audio sampling rate. | |
IMPAudioBitWidth | bitwidth |
Audio sampling precision. | |
IMPAudioSoundMode | soundmode |
Audio channel mode. | |
int | frmNum |
Number of cached frames, range: [2, MAX_AUDIO_FRAME_NUM]. | |
int | numPerFrm |
Number of sample points per frame. | |
int | chnCnt |
Number of channels supported. | |
IMPAudioBitWidth | bitwidth |
Audio sampling precision. | |
IMPAudioSoundMode | soundmode |
Audio channel mode. | |
uint32_t * | virAddr |
Audio frame data virtual address. | |
uint32_t | phyAddr |
Audio frame data physical address. | |
int64_t | timeStamp |
Audio frame data time stamp. | |
int | seq |
Audio frame data serial number. | |
int | len |
Audio frame data length. | |
int | usrFrmDepth |
Audio frame buffer depth. | |
int | Rev |
retain | |
int | chnTotalNum |
The total number of cached output channel. | |
int | chnFreeNum |
Free cache blocks. | |
int | chnBusyNum |
The number of cache be used. | |
uint8_t * | stream |
Data stream pointer. | |
uint32_t | phyAddr |
Data stream physical address. | |
int | len |
Audio stream length. | |
int64_t | timeStamp |
time stamp | |
int | seq |
Audio stream serial number. | |
IMPAudioPalyloadType | type |
Audio payload data type. | |
int | bufSize |
buf size, in order to frame the unit, [2 ~ MAX_AUDIO_FRAME_NUM] | |
uint32_t * | value |
Protocol attribute pointer. | |
IMPAudioPalyloadType | type |
Encoding protocol type. | |
int | maxFrmLen |
Maximum code stream length. | |
char | name [16] |
encoder name | |
int(* | openEncoder )(void *encoderAttr, void *encoder) |
int(* | encoderFrm )(void *encoder, IMPAudioFrame *data, unsigned char *outbuf, int *outLen) |
int(* | closeEncoder )(void *encoder) |
IMPAudioPalyloadType | type |
Audio decoding protocol type. | |
int | bufSize |
Audio decoder cache size. | |
IMPAudioDecMode | mode |
Decoding mode. | |
void * | value |
Specific protocol attribute pointer. | |
IMPAudioPalyloadType | type |
Audio decoding protocol type. | |
char | name [16] |
Audio encoder name. | |
int(* | openDecoder )(void *decoderAttr, void *decoder) |
int(* | decodeFrm )(void *decoder, unsigned char *inbuf, int inLen, unsigned short *outbuf, int *outLen, int *chns) |
int(* | getFrmInfo )(void *decoder, void *info) |
int(* | closeDecoder )(void *decoder) |
int | TargetLevelDbfs |
Gain level, the value of [0, 31], this refers to the target volume level, the unit is dB, is negative value. More... | |
int | CompressionGaindB |
Set the maximum gain value, [0, 90], 0 represents no gain, the greater the value, the higher the gain. More... | |
audio module, including audio record and playback, audio encoding and decoding, volume and gain setting, (audio) echo cancellation, automatic gain function and so on
Audio function includes 5 modules: audio input, audio output, audio echo cancellation, audio encoding and audio decoding.
The existence of the audio input and audio output is the concept of the equipment and the channel, we all know that a MIC is a Device, and also can have multiple Channel input.
Similarly a SPK is a playback Device, and can also have multiple Channel output.
One Device supports only one Channel in this current version of the audio API.
Audio echo cancellation is located in the audio input interface, explicit explanation is embodied in the functional description.
Audio encoding, the current audio API can support such format audio coding: PT_G711A, PT_G711U and PT_G726 , when it comes to add a new encoding method, it is a must to register the encoder.
Audio decoding, the current audio API can support such format audio coding: PT_G711A, PT_G711U and PT_G726 , when it comes to add a new decoding method, it is a must to register the decoder.
The following is a detailed description of each module
Audio input Device ID correspondence, 0: corresponding digital MIC; 1: corresponding simulation MIC
Audio input Channel, the current API only supports single channel.
Set the audio input volume, volume range: [-30 ~ 120]. - 30 represents mute, 120 represents the amplification of sound to 30dB, step 0.5dB. 60 means that the volume is set to a critical point,
in that case ,software does not increase or decrease the volume, when the volume value is less than 60, for each drop of 1, the volume is reduced by 0.5dB; when the volume value is greater than 60, for each rise of 1 the volume is increased by 0.5dB.
Audio output Device ID correspondence, 0: corresponding to the default SPK; 1: MIC corresponding to other SPK
Audio output Channel,the current API only supports single channel.
Set the audio output volume, volume range: [-30 ~ 120]. - 30 represents mute, 120 represents the amplification of sound to 30dB, step 0.5dB. 60 means that the volume is set to a critical point,
in that case ,software does not increase or decrease the volume, when the volume value is less than 60, for each drop of 1, the volume is reduced by 0.5dB; when the volume value is greater than 60, for each rise of 1 the volume is increased by 0.5dB.
Audio echo cancellation function belongs to the audio input interface, so to enable echo cancellation, you must first enable audio input device and channel.
Audio echo cancellation currently supports audio sampling rate of 8K and 16K. A frame data sample number is the multiple of 10ms audio data (e.g., 8K sampling rate, the data fed into: 8000 x 2 / 100 = 160byte integer multiple).
Audio echo cancellation for different devices and different packages will have different sound effects.
Adaptive support is not available in Audio Echo Cancellation (the AEC is not automatically configured), so for different devices there will be different echo cancellation parameters,
The parameter file of the Audio echo cancellation is located in the /etc/webrtc_profile.ini configuration file.
The profile format is as follows (Main need to debug the three parameters):
[Set_Far_Frame]
Frame_V=0.3
[Set_Near_Frame]
Frame_V=0.1
delay_ms=150
[Set_Far_Frame] represents the remote(far-end) parameter, the SPK represents the playback data parameters.
Fram_V represents audio amplitude scaling, the playback data can be adjusted by adjusting these parameters (this is used only for echo cancellation).
[Set_Near_Frame] represents the proximal(near-end) parameter, the MIC represents record data parameters.
Fram_V represents the audio amplitude ratio, the adjustment of these parameters can adjust the amplitude of the recording data (this is only used for echo cancellation).
Delay_ms, because of the delay between software and hardware, and the position between the SPK and MIC(they are placed at a certain distance), the SPK playback data will be processed by the MIC again. So, there will be some delay because the SPK data will have some impact on the MIC data.
This time represents the time difference of the playback data in data recording. (delay to assure that there won't be any echo at all).
The current audio API supports PT_G711A, PT_G711U and PT_G726 format audio coding, if you need to add a new encoding method, you need to call the IMP_AENC_RegisterEncoder interface to register the encoder.
The current audio API supports PT_G711A, PT_G711U and PT_G726 format audio decoding, if you need to add a new decoding method, you need to call the IMP_ADEC_RegisterDecoder interface to register the decoder.
enum IMPAudioBitWidth |
enum IMPAudioDecMode |
enum IMPAudioSampleRate |
Audio sampling rate definition.
enum IMPAudioSoundMode |
enum IMPBlock |
enum Level_ns |
int IMP_ADEC_ClearChnBuf | ( | int | adChn | ) |
Clears the current audio data cache in the audio decode channel.
[in] | adChn | channel number |
0 | success. |
non-0 | failure. |
int IMP_ADEC_CreateChn | ( | int | adChn, |
IMPAudioDecChnAttr * | attr | ||
) |
Create audio decode channel.
[in] | adChn | channel number |
[in] | attr | Channel attribute pointer. |
0 | success. |
non-0 | failure. |
int IMP_ADEC_DestroyChn | ( | int | adChn | ) |
Destory audio decoding channel.
[in] | adChn | channel number |
0 | success. |
non-0 | failure. |
int IMP_ADEC_GetStream | ( | int | adChn, |
IMPAudioStream * | stream, | ||
IMPBlock | block | ||
) |
Get the decoded stream.
[in] | adChn | channel number |
[in] | stream | Get decoded stream |
[in] | block | Blocking / non blocking identifier. |
0 | success. |
non-0 | failure. |
int IMP_ADEC_PollingStream | ( | int | AdChn, |
unsigned int | timeout_ms | ||
) |
Polling decode audio stream cache.
[in] | AdChn | audio decode input channel number |
[in] | timeout_ms | polling timeout time |
0 | success. |
non-0 | failure. |
int IMP_ADEC_RegisterDecoder | ( | int * | handle, |
IMPAudioDecDecoder * | decoder | ||
) |
Register decoder.
[in] | ps32handle | register handle |
[in] | decoder | Decoder attributes structure. |
0 | success. |
non-0 | failure. |
int IMP_ADEC_ReleaseDecoder | ( | int * | handle | ) |
Unregister Decoder.
[in] | ps32handle | Register handle (the handle obtained at the time of registration of the decoder). |
0 | success. |
non-0 | failure. |
int IMP_ADEC_ReleaseStream | ( | int | adChn, |
IMPAudioStream * | stream | ||
) |
Release of the stream from the audio decoding channel.
[in] | adChn | channel number |
[in] | stream | audio stream pointer |
0 | success. |
non-0 | failure. |
int IMP_ADEC_SendStream | ( | int | adChn, |
IMPAudioStream * | stream, | ||
IMPBlock | block | ||
) |
Send audio stream to audio decoding channel.
[in] | adChn | channel number |
[in] | stream | audio stream |
[in] | block | Blocking / non blocking identifier. |
0 | success. |
non-0 | failure. |
int IMP_AENC_CreateChn | ( | int | aeChn, |
IMPAudioEncChnAttr * | attr | ||
) |
Create audio encode channel.
[in] | aeChn | channel number |
[in] | attr | Audio encode channel attribute pointer. |
0 | success. |
non-0 | failure. |
int IMP_AENC_DestroyChn | ( | int | aeChn | ) |
Destory audio encode channel.
[in] | aeChn | channel number |
0 | success. |
non-0 | failure. |
int IMP_AENC_GetStream | ( | int | aeChn, |
IMPAudioStream * | stream, | ||
IMPBlock | block | ||
) |
Get the encoded stream.
[in] | aeChn | channel number |
[in] | stream | Get audio encoding |
[in] | block | Blocking / non blocking identifier. |
0 | success. |
non-0 | failure. |
int IMP_AENC_PollingStream | ( | int | AeChn, |
unsigned int | timeout_ms | ||
) |
Polling encoded audio stream cache.
[in] | AeChn | Audio encoding input channel number. |
[in] | timeout_ms | Polling timeout time |
0 | success. |
non-0 | failure. |
int IMP_AENC_RegisterEncoder | ( | int * | handle, |
IMPAudioEncEncoder * | encoder | ||
) |
Register encoder.
[in] | ps32handle | register handle |
[in] | encoder | Encoder attribute structure. |
0 | success. |
non-0 | failure. |
int IMP_AENC_ReleaseEncoder | ( | int * | handle | ) |
Release encoder.
[in] | ps32handle | Register handle (the handle obtained at the time of registration of the encoder). |
0 | success. |
non-0 | failure. |
int IMP_AENC_ReleaseStream | ( | int | aeChn, |
IMPAudioStream * | stream | ||
) |
Releases the stream from the audio encoding channel.
[in] | aeChn | channel number |
[in] | stream | Get audio stream pointer |
0 | success. |
non-0 | failure. |
int IMP_AENC_SendFrame | ( | int | aeChn, |
IMPAudioFrame * | frm | ||
) |
Send audio encoding audio frame.
[in] | aeChn | channel number |
[in] | frm | Audio frame structure pointer. |
0 | success. |
non-0 | failure. |
int IMP_AI_Disable | ( | int | audioDevId | ) |
Disable audio input device.
[in] | audioDevId | Audio device number |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableAec | ( | int | aiDevId, |
int | aiChn | ||
) |
Disable audio echo cancellation feature.
[in] | aiDevId | Audio input device number |
[in] | aiChn | audio input channel number |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableAecRefFrame | ( | int | audioDevId, |
int | aiChn, | ||
int | audioAoDevId, | ||
int | aoChn | ||
) |
Close access to the reference frame.
[in] | audioDevId | audio device number. |
[in] | aiChn | audio input channel number. |
[in] | audioAoDevId | audio output device number. |
[in] | aoChn | audio output channel number. |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableAgc | ( | void | ) |
Disable AI automatic gain feature.
no. |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableChn | ( | int | audioDevId, |
int | aiChn | ||
) |
Disable audio input channel.
[in] | audioDevId | Audio device number |
[in] | aiChn | Audio input channel number |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableHpf | ( | void | ) |
Disable AI high pass filtering function.
no. |
0 | success. |
non-0 | failure. |
int IMP_AI_DisableNs | ( | void | ) |
Disable noise suppression.
no. |
0 | success. |
non-0 | failure. |
int IMP_AI_Enable | ( | int | audioDevId | ) |
Enable audio input device.
[in] | audioDevId | Audio device number |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableAec | ( | int | aiDevId, |
int | aiChn, | ||
int | aoDevId, | ||
int | aoChn | ||
) |
Enable audio echo cancellation feature of the specified audio input and audio output.
[in] | aiDevId | Need to perform audio echo cancellation of the audio input device number. |
[in] | aiChn | Need to perform audio echo cancellation of the audio input channel number. |
[in] | aoDevId | Need to perform audio echo cancellation of the audio output device number. |
[in] | aoChn | Need to perform audio echo cancellation of the audio output channel number. |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableAecRefFrame | ( | int | audioDevId, |
int | aiChn, | ||
int | audioAoDevId, | ||
int | aoChn | ||
) |
Open access reference frame.
[in] | audioDevId | audio device number. |
[in] | aiChn | audio input channel number. |
[in] | audioAoDevId | audio output device number. |
[in] | aoChn | audio output channel number. |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableAgc | ( | IMPAudioIOAttr * | attr, |
IMPAudioAgcConfig | agcConfig | ||
) |
Enable automatic gain of audio input.
[in] | attr | Requires automatic gain of the audio attribute. |
[in] | agcConfig | Automatic gain parameter configuration, configuration magnification. |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableChn | ( | int | audioDevId, |
int | aiChn | ||
) |
Enable audio input channel.
[in] | audioDevId | Audio device number |
[in] | aiChn | Audio input channel number |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableHpf | ( | IMPAudioIOAttr * | attr | ) |
Enable audio input for high pass filtering.
[in] | attr | need high pass filtering of audio attribute. |
0 | success. |
non-0 | failure. |
int IMP_AI_EnableNs | ( | IMPAudioIOAttr * | attr, |
int | mode | ||
) |
Enable specified audio input noise suppression.
[in] | attr | Noise suppression is required for the audio attribute. |
[in] | mode | Noise suppression level 0 ~ 3, see Level_ns. |
0 | success. |
non-0 | failure. |
int IMP_AI_GetChnParam | ( | int | audioDevId, |
int | aiChn, | ||
IMPAudioIChnParam * | chnParam | ||
) |
Set audio input channel parameters.
[in] | audioDevId | audio device number |
[in] | aiChn | audio input channel number |
[out] | chnParam | audio channel parameters |
0 | success. |
non-0 | failure. |
int IMP_AI_GetFrame | ( | int | audioDevId, |
int | aiChn, | ||
IMPAudioFrame * | frm, | ||
IMPBlock | block | ||
) |
Get audio frame.
[in] | audioDevId | Audio device number |
[in] | aiChn | Audio input channel number |
[out] | frm | Audio frame structure pointer. |
[in] | block | Blocking / non blocking identifier. |
0 | success. |
non-0 | failure. |
int IMP_AI_GetFrameAndRef | ( | int | audioDevId, |
int | aiChn, | ||
IMPAudioFrame * | frm, | ||
IMPAudioFrame * | ref, | ||
IMPBlock | block | ||
) |
Get audio frame and output reference frame.
[in] | audioDevId | audio device number. |
[in] | aiChn | audio input channel number. |
[out] | frm | audio frame structure pointer. |
[out] | ref | reference frame structure pointer. |
[in] | block | block and non-block identitifier. |
0 | success. |
non-0 | failure. |
int IMP_AI_GetGain | ( | int | audioDevId, |
int | aiChn, | ||
int * | aiGain | ||
) |
Get AI gain value.
[in] | audioDevId | Audio input device number |
[in] | aiChn | Audio input channel number |
[out] | aiGain | audio input gain |
0 | success. |
non-0 | failure. |
int IMP_AI_GetPubAttr | ( | int | audioDevId, |
IMPAudioIOAttr * | attr | ||
) |
Get the attribute of the audio input device.
[in] | audioDevId | Audio device number |
[out] | attr | Audio device attribute pointer |
0 | success. |
non-0 | failure. |
int IMP_AI_GetVol | ( | int | audioDevId, |
int | aiChn, | ||
int * | vol | ||
) |
Get the volume of the audio input.
[in] | aiDevId | Audio input device number |
[in] | aiChn | Audio input channel number |
[out] | vol | audio input volume |
0 | success. |
non-0 | failure. |
int IMP_AI_PollingFrame | ( | int | audioDevId, |
int | aiChn, | ||
unsigned int | timeout_ms | ||
) |
Polling audio stream cache.
[in] | audioDevId | Audio device number |
[in] | aiChn | Audio input channel number |
[in] | timeout_ms | Polling timeout time. |
0 | success. |
non-0 | failure. |
int IMP_AI_ReleaseFrame | ( | int | audioDevId, |
int | aiChn, | ||
IMPAudioFrame * | frm | ||
) |
Release audio frame.
[in] | audioDevId | Audio device number |
[in] | aiChn | Audio input channel number |
[in] | frm | Audio frame structure pointer |
0 | success. |
non-0 | failure. |
int IMP_AI_SetChnParam | ( | int | audioDevId, |
int | aiChn, | ||
IMPAudioIChnParam * | chnParam | ||
) |
Set audio input channel parameters.
[in] | audioDevId | Audio device number |
[in] | aiChn | audio input channel number |
[in] | chnParam | audio frame structure pointer |
0 | success. |
non-0 | failure. |
int IMP_AI_SetGain | ( | int | audioDevId, |
int | aiChn, | ||
int | aiGain | ||
) |
Set audio input gain.
[in] | audioDevId | Audio input device number |
[in] | aiChn | Audio input channel number |
[out] | aiGain | Audio input gain, range [0 ~ 31]. |
0 | success. |
non-0 | failure. |
int IMP_AI_SetPubAttr | ( | int | audioDevId, |
IMPAudioIOAttr * | attr | ||
) |
Set audio input device attribute.
[in] | audioDevId | Audio device number |
[in] | attr | Audio device attribute pointer |
0 | success. |
non-0 | failure. |
int IMP_AI_SetVol | ( | int | audioDevId, |
int | aiChn, | ||
int | aiVol | ||
) |
ACODEC configuration.
Set audio input volume.
[in] | aiDevId | audio input device number |
[in] | aiChn | audio input channel number |
[in] | aiVol | audio input volume |
0 | success. |
non-0 | failure. |
sample code
int IMP_AI_SetVolMute | ( | int | audioDevId, |
int | aiChn, | ||
int | mute | ||
) |
Set audio input mute.
[in] | aiDevId | Audio input device number |
[in] | aiChn | Audio input channel number |
[out] | mute | Audio input mute flag, mute = 0: off mute, mute = 1: on mute. |
0 | success. |
non-0 | failure. |
int IMP_AO_CacheSwitch | ( | int | audioDevId, |
int | aoChn, | ||
int | cache_en | ||
) |
close audio play cache
[in] | audioDevId | audio device number. |
[in] | aoChn | audio output channel number. |
[in] | cache_en | switch of control cache. |
0 | success |
non-0 | failure. |
int IMP_AO_ClearChnBuf | ( | int | audioDevId, |
int | aoChn | ||
) |
Clear the current audio data cache in the audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
0 | success. |
non-0 | failure. |
int IMP_AO_Disable | ( | int | audioDevId | ) |
Disable audio output device.
[in] | audioDevId | audio device number |
0 | success. |
non-0 | failure. |
int IMP_AO_DisableAgc | ( | void | ) |
Disable AO automatic gain feature.
no. |
0 | success. |
non-0 | failure. |
int IMP_AO_DisableChn | ( | int | audioDevId, |
int | aoChn | ||
) |
Disable audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
0 | success. |
non-0 | failure. |
int IMP_AO_DisableHpf | ( | void | ) |
Disable AO high pass filtering function.
no. |
0 | success. |
non-0 | failure. |
int IMP_AO_Enable | ( | int | audioDevId | ) |
Enable audio output device.
[in] | audioDevId | audio device number |
0 | success. |
non-0 | failure. |
int IMP_AO_EnableAgc | ( | IMPAudioIOAttr * | attr, |
IMPAudioAgcConfig | agcConfig | ||
) |
Enable audio output automatic gain feature.
[in] | attr | need automatic gain of the audio attribute. |
[in] | agcConfig | automatic gain parameter configuration, configuration magnification. |
0 | success. |
non-0 | failure. |
int IMP_AO_EnableChn | ( | int | audioDevId, |
int | aoChn | ||
) |
Enable audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
0 | success. |
non-0 | failure. |
int IMP_AO_EnableHpf | ( | IMPAudioIOAttr * | attr | ) |
Enable audio output for high pass filtering.
[in] | attr | need high pass filtering of audio attribute. |
0 | success. |
non-0 | failure. |
int IMP_AO_GetGain | ( | int | audioDevId, |
int | aoChn, | ||
int * | aoGain | ||
) |
Get audio output gain.
[in] | audioDevId | audio output device number. |
[in] | aoChn | audio output channel number. |
[out] | aoGain | audio output gain. |
0 | success. |
non-0 | failure. |
int IMP_AO_GetPubAttr | ( | int | audioDevId, |
IMPAudioIOAttr * | attr | ||
) |
Get audio input and output device attribute.
[in] | audioDevId | audio device number |
[out] | attr | audio output device attribute pointer |
0 | success. |
non-0 | failure. |
int IMP_AO_GetVol | ( | int | audioDevId, |
int | aoChn, | ||
int * | vol | ||
) |
Get audio output channel volume.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
[out] | aoVol | audio output volume |
0 | success. |
non-0 | failure. |
int IMP_AO_PauseChn | ( | int | audioDevId, |
int | aoChn | ||
) |
Pause audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
0 | success. |
non-0 | failure. |
int IMP_AO_QueryChnStat | ( | int | audioDevId, |
int | aoChn, | ||
IMPAudioOChnState * | status | ||
) |
Query the current audio data cache status in the audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
[out] | status | Cache state structure pointer. |
0 | success. |
non-0 | failure. |
int IMP_AO_ResumeChn | ( | int | audioDevId, |
int | aoChn | ||
) |
Resume audio output channel.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
0 | success. |
non-0 | failure. |
int IMP_AO_SendFrame | ( | int | audioDevId, |
int | aoChn, | ||
IMPAudioFrame * | data, | ||
IMPBlock | block | ||
) |
Send audio output frame.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
[in] | data | audio frame sturcture pointer |
[in] | block | Blocking / non blocking identifier. |
0 | success. |
non-0 | failure. |
int IMP_AO_SetGain | ( | int | audioDevId, |
int | aoChn, | ||
int | aoGain | ||
) |
Set audio output gain.
[in] | audioDevId | Audio output device number |
[in] | aoChn | audio output channel number |
[out] | aoGain | Audio output gain, range [0 ~ 0xcb]. |
0 | success. |
non-0 | failure. |
int IMP_AO_SetPubAttr | ( | int | audioDevId, |
IMPAudioIOAttr * | attr | ||
) |
Set audio input and output device attribute.
[in] | audioDevId | audio device number |
[in] | attr | audio output device attribute pointer |
0 | success. |
non-0 | failure. |
int IMP_AO_SetVol | ( | int | audioDevId, |
int | aoChn, | ||
int | aoVol | ||
) |
Set audio output channel volume.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
[in] | aoVol | audio output volume |
0 | success. |
non-0 | failure. |
int IMP_AO_SetVolMute | ( | int | audioDevId, |
int | aoChn, | ||
int | mute | ||
) |
Set audio output mute.
[in] | audioDevId | audio device number |
[in] | aoChn | audio output channel number |
[out] | mute | Audio output mute flag, mute = 0: off mute, mute = 1: on mute. |
0 | success. |
non-0 | failure. |
int IMP_AO_Soft_Mute | ( | int | audioDevId, |
int | aoChn | ||
) |
Output soft mute control.
[in] | audioDevId | Audio output device number. |
[in] | aoChn | Audio input channel number. |
0 | success. |
non-0 | failure. |
int IMP_AO_Soft_UNMute | ( | int | audioDevId, |
int | aoChn | ||
) |
Output soft unmute control.
[in] | audioDevId | Audio output device number. |
[in] | aoChn | Audio input channel number. |
0 | success. |
non-0 | failure. |
int CompressionGaindB |
Set the maximum gain value, [0, 90], 0 represents no gain, the greater the value, the higher the gain.
int TargetLevelDbfs |
Gain level, the value of [0, 31], this refers to the target volume level, the unit is dB, is negative value.
The smaller the value, the greater the volume.