|
Wave Arts VQE
1.00
Voice Quality Enhancement
|
Wave Arts VQE object. More...
#include <WaVQE.h>
Public Member Functions | |
| WaVQE (WaAudioDevPort *devPort, VQEParam *vqeParam) | |
| WaVQE constructor. | |
| ~WaVQE () | |
| destructor | |
| VQEParam * | GetParam () |
| Get parameters. | |
| int | Open (WadParam *param, WadCallbackFn *inFn, WadCallbackFn *outFn, void *arg) |
| Open devices for streaming. | |
| void | Close () |
| Close devices and release memory. | |
| int | InCallback (float *buf, int numFrames, int numChan) |
| input callback | |
| int | OutCallback (float *buf, int numFrames, int numChan) |
| output callback | |
| void | SetAecEnable (bool isAecEnabled) |
| Enable or disable AEC. | |
| void | AutoGainSetFn (bool isIncr, float incr) |
| Auto-gain callback function. | |
| void | SetAutoGainEnable (bool enable) |
| Enable or disable auto-gain. | |
| void | SetDeclipEnable (bool enable) |
| Enable or disable declip. | |
| void | SetInjectNoise (bool enable) |
| Enable or disable noise injection. | |
Static Public Member Functions | |
| static void | GetDefaultParam (VQEParam *vqeParam) |
| Get default VQE parameters. | |
Protected Member Functions | |
| void | Reset () |
| Reset AEC and other signal processing. | |
| bool | OpenDumpFile (AFileOut **pAfo, char *name, int sampRate, int numChan) |
| Open a single dump file. | |
| void | OpenDumpFiles (WadParam *param) |
| Open all dump files. | |
| void | PreProcess (float *buf, int numFrames, int numChan) |
| Apply pre-processing, input signal before AEC. | |
| void | PostProcess (float *buf, int numFrames, int numChan) |
| Apply post-processing, input signal after AEC. | |
| void | InjectShortNoise (short *buf, int n) |
| Inject 16-bit integer noise. | |
| void | InjectFloatNoise (float *buf, int n) |
| Inject 32-bit float noise. | |
| bool | DeliverInputBuf (float *buf) |
| Deliver input buffer to application. | |
| bool | FetchOutputBuf (float *buf) |
| Fetch an output buffer from application. | |
| void | MakeDumpPath (char *path, unsigned maxLen, char *name) |
| Make dump file pathname. | |
| void | DumpResponse () |
| Dump the impulse response of the AEC. | |
| void | SetAecProcessor (AecProcessor *aec) |
| change AEC algorithm, NULL means no AEC | |
| void | FillAecLatData (AecLatData *data) |
| fill AecLatData with current device names and sample rate | |
Protected Attributes | |
| WaAudioDevPortObj * | resPort |
| resampled device port | |
| WadParam | param |
| open parameters | |
| VQEParam | vqeParam |
| parameters | |
| bool | syncBuffers |
| T/F if synchronizing input and output for AEC alg. | |
| AecLatCalObject * | aecLatCal |
| calibrator, or NULL if none | |
| AecProcessor * | aecObj |
| EC algorithm pointer, so it can be deleted. | |
| AecProcessor * | aecProcessor |
| EC to use, either aecLatCal or aecObj, don't delete. | |
| WadCallbackFn * | appInFn |
| original application input callback | |
| WadCallbackFn * | appOutFn |
| original application output callback | |
| void * | appArg |
| application callback arg | |
| bool | isAecEnabled |
| is AEC currently enabled? | |
| AecInFifo * | inFifo |
| fifo for input sample buffers | |
| bool | isInputReady |
| is input fifo primed? | |
| int | overCount |
| count of consecutive buffer overruns | |
| int | underCount |
| count of consecutive buffer underruns | |
| AFileOut * | afoIn0 |
| in pre AEC, i.e., recording after sample rate compensation | |
| AFileOut * | afoIn1 |
| in post AEC, i.e., echo-cancelled recording, sent to far side | |
| AFileOut * | afoOut0 |
| out pre AEC, i.e. (far) reference signal | |
| AFileOut * | afoOut1 |
| out post AEC, i.e. sent to speaker | |
| int | numIn |
| count of input callbacks since last output | |
| int | numOut |
| count of output callbacks since last input | |
| int | inHist [kMaxBurst] |
| histogram of input burst lengths | |
| int | outHist [kMaxBurst] |
| histogram of output buffer burst lengths | |
| int | totalNumIn |
| count of total input buffers for debugging | |
| int | totalNumOut |
| count of total output buffers for debugging | |
| int | totalNumAppIn |
| count of total application input callbacks for debugging | |
| int | totalNumAppOut |
| count of total application output callbacks for debugging | |
| int | numUnder |
| number of underruns | |
| int | numOver |
| number of overruns | |
| short * | shortOutBuf |
| temp buffer | |
| short * | shortInBuf |
| temp buffer | |
| float * | lastRefBuf |
| last reference signal buffer | |
| float * | recBuf |
| record buffer read from FIFO | |
| AutoGain * | autoGain |
| auto-gain object | |
| bool | isAutoGainEnabled |
| is auto-gain currently enabled? | |
| DeclipLpf * | declip |
| declip object | |
| bool | isDeclipEnabled |
| is declip currently enabled? | |
| bool | injectNoise |
| T/F if injecting noise. | |
| int | mlsReg |
| MLS register. | |
| int | mlsMask |
| MLS generating mask. | |
| int | mlsMsbMask |
| MSB mask. | |
Wave Arts VQE object.
WaVQE is a device port (WaAudioDevPortObj) which handles AEC and other DSP processing. WaVQE may synchronize the audio stream sampling rates by using a WadResPort or WadResInPort, depending on the AecSyncParam passed in the VQEParam structure when WaVQE is created. WaVQE prepares associated input and output buffers for processing by an AEC algorithm. Input buffers are placed in the AecInFifo until a sufficient number have accumulated. During the output callback, the output buffer is paired with a buffer read from the fifo, and the AEC algorithm is called with the pair of buffers. WaVQE also supports pre and post processing of buffers. This is used to implement auto-gain and declip processing.
VQE should be opened with buffers that are a multiple of 10 msec, due to internal sample rate conversion that requires integer buffer lengths, and which may have to convert between 44.1 kHz and multiples of 8 kHz.
| WaVQE::WaVQE | ( | WaAudioDevPort * | devPort, |
| VQEParam * | vqeParam | ||
| ) |
WaVQE constructor.
| [in] | devPort | device port |
| [in] | vqeParam | VQE parameters |
| void WaVQE::AutoGainSetFn | ( | bool | isIncr, |
| float | incr | ||
| ) |
Auto-gain callback function.
| [in] | isIncr | true if incrementing gain, else false if decrementing gain |
| [in] | incr | volume increment (always > 0) |
| void WaVQE::Close | ( | ) | [virtual] |
Close devices and release memory.
Close the devices and release all memory associated with streaming. Different devices can be re-opened with different parameters without having to recreate the WaAudioDev object.
Implements WaAudioDevPort.
| void WaVQE::GetDefaultParam | ( | VQEParam * | vqeParam | ) | [static] |
Get default VQE parameters.
| [out] | vqeParam | pointer to parameter structure to be filled |
| int WaVQE::Open | ( | WadParam * | param, |
| WadCallbackFn * | inFn, | ||
| WadCallbackFn * | outFn, | ||
| void * | arg | ||
| ) | [virtual] |
Open devices for streaming.
Open devices for streaming with provided parameters. Asynchronous callbacks fetch and deliver sample buffers: inFn delivers input sample buffers and outFn fetches output sample buffers. Streaming directions are determined by valid device IDs in parameter structure, at least one direction must be enabled. Pass NULL for callback if that direction is not enabled.
| [in] | param | Stream parameters |
| [in] | inFn | Input callback function, or NULL |
| [in] | outFn | Output callback function, or NULL |
| [in] | arg | Argument to callbacks |
Implements WaAudioDevPort.
| void WaVQE::SetAecEnable | ( | bool | isAecEnabled | ) |
Enable or disable AEC.
| [in] | isAecEnabled | true if enable, else false |
| void WaVQE::SetAutoGainEnable | ( | bool | enable | ) |
Enable or disable auto-gain.
| [in] | enable | true to enable, false to disable |
| void WaVQE::SetDeclipEnable | ( | bool | enable | ) |
Enable or disable declip.
| [in] | enable | true to enable, false to disable |
| void WaVQE::SetInjectNoise | ( | bool | enable | ) |
Enable or disable noise injection.
| [in] | enable | true to enable, false to disable |
Noise injection injects low level MLS (maximum length sequence) noise into the output (error signal) of the echo canceller, after noise gating. This is useful to ensure there is always a low level signal coming out of the AEC. Many codecs do not have logic to handle denormalized arithmetic, so gating the signal to 0 in VQE may cause downstream codecs to burn huge amounts of CPU if demormalized numbers are created. The level of the noise is one LSB at 16-bits.
1.7.5.1