sipxmedialib
Version 3.3
|
#include <MpVadBase.h>
Protected Attributes | |
UtlString | mName |
Name useful for debugging to distiguish multiple instances. More... | |
Static Protected Attributes | |
static UtlString | smDefaultAlgorithm |
Name of algorithm to be used by default. More... | |
Creators | |
virtual OsStatus | init (int samplesPerSec)=0 |
Initialize VAD with given sample rate. More... | |
virtual | ~MpVadBase () |
Destructor. More... | |
static MpVadBase * | createVad (const UtlString &name="") |
Factory method for VAD algorithms creation. More... | |
Manipulators | |
virtual MpSpeechType | processFrame (uint32_t packetTimeStamp, const MpAudioSample *pBuf, unsigned inSamplesNum, const MpSpeechParams &speechParams, UtlBoolean calcEnergyOnly=FALSE)=0 |
Detect speech presence. More... | |
virtual OsStatus | setParam (const char *paramName, void *value)=0 |
Set algorithm parameter. More... | |
virtual void | reset ()=0 |
Prepare to process other unrelated audio stream. More... | |
static void | setDefaultAlgorithm (const UtlString &name) |
Set algorithm to be used by default. More... | |
Accessors | |
virtual int | getEnergy () const =0 |
Return weighted energy of current frame. More... | |
void | setName (const UtlString &name) |
Set name. More... | |
Base class for all VAD algorithms.
To create concrete class you could directly instantiate it or use MpVadBase::createVad() static method for greater flexibility.
|
inlinevirtual |
Destructor.
|
pure virtual |
Initialize VAD with given sample rate.
Should be called before any other class methods.
Implemented in MpVadSimple.
|
static |
Factory method for VAD algorithms creation.
[in] | name | - name of VAD algorithm to use. Use empty string to get default algorithm. |
|
pure virtual |
Detect speech presence.
[in] | packetTimeStamp | - RTP timestamp of packet. |
[in] | pBuf | - buffer with input data. |
[in] | inSamplesNum | - number of samples of actual data, passed to this function. |
[in] | speechParams | - various parameters of speech. |
[in] | calcEnergyOnly | - if TRUE, VAD should calculate energy only. |
Implemented in MpVadSimple.
|
pure virtual |
Set algorithm parameter.
[in] | paramName | - name of parameter |
[in] | value | - value, can be any type, before call cast it to void* |
Implemented in MpVadSimple.
|
static |
Set algorithm to be used by default.
Initially default algorithm is defined at compile time. Using this function you can change default algorithm at run-time or switch back to compile-time default.
[in] | name | - name of algorithm to use by default. Reverts to compile-time default if empty. |
|
pure virtual |
Prepare to process other unrelated audio stream.
Only initialized algorithm can be reseted. Calling reset() should bring algorithm to the original state as it was right after init(). So init() should NOT be called after reset().
Implemented in MpVadSimple.
|
pure virtual |
Return weighted energy of current frame.
Implemented in MpVadSimple.
void setName | ( | const UtlString & | name | ) |
Set name.
|
staticprotected |
Name of algorithm to be used by default.
|
protected |
Name useful for debugging to distiguish multiple instances.