17 #include <utl/UtlDefs.h> 18 #include <os/OsStatus.h> 19 #include <utl/UtlString.h> 48 virtual OsStatus
init(
int samplesPerSec) = 0;
76 unsigned inSamplesNum,
78 UtlBoolean calcEnergyOnly =
FALSE) = 0;
91 virtual OsStatus
setParam(
const char* paramName,
void* value) = 0;
111 virtual void reset() = 0;
128 void setName(
const UtlString& name);
150 #endif // _MpVadBase_h_ Definition: MpVadBase.h:40
virtual MpSpeechType processFrame(uint32_t packetTimeStamp, const MpAudioSample *pBuf, unsigned inSamplesNum, const MpSpeechParams &speechParams, UtlBoolean calcEnergyOnly=FALSE)=0
Detect speech presence.
virtual int getEnergy() const =0
Return weighted energy of current frame.
int16_t MpAudioSample
Definition: MpTypes.h:44
static void setDefaultAlgorithm(const UtlString &name)
Set algorithm to be used by default.
Definition: MpVadBase.cpp:60
MpSpeechType
Type of audio data.
Definition: MpTypes.h:65
UtlString mName
Name useful for debugging to distiguish multiple instances.
Definition: MpVadBase.h:143
void setName(const UtlString &name)
Set name.
Definition: MpVadBase.cpp:67
virtual ~MpVadBase()
Destructor.
Definition: MpVadBase.h:65
virtual OsStatus init(int samplesPerSec)=0
Initialize VAD with given sample rate.
static UtlString smDefaultAlgorithm
Name of algorithm to be used by default.
Definition: MpVadBase.h:141
static MpVadBase * createVad(const UtlString &name="")
Factory method for VAD algorithms creation.
Definition: MpVadBase.cpp:31
virtual void reset()=0
Prepare to process other unrelated audio stream.
#define FALSE
Definition: PlgDefsV1.h:37
virtual OsStatus setParam(const char *paramName, void *value)=0
Set algorithm parameter.