11 #ifndef _INCLUDED_MPAUDIOBUF_H 12 #define _INCLUDED_MPAUDIOBUF_H 69 void setTimecode(
unsigned timecode) {assert(!
"MpAudioBuf::setTimecode() is not implemented!");}
102 unsigned getTimecode()
const {assert(!
"MpAudioBuf::getTimecode() is not implemented!");
return 0;}
127 unsigned int tolerance = 0)
const;
MpAudioSample mAmplitude
Amplitude of the audio data in this buffer.
Definition: MpTypes.h:96
MpSpeechType mSpeechType
Whether buffer contains speech.
Definition: MpTypes.h:95
#define MPBUF_TYPECHECKED_COPY(classname, buffer_type, base_classname)
Copy object from base type with type check.
Definition: MpBuf.h:407
MpAudioSample * getSamplesWritePtr()
Get writable pointer to audio data.
Definition: MpAudioBuf.h:96
const MpAudioSample * getSamplesPtr() const
Get pointer to audio data.
Definition: MpAudioBuf.h:93
MpAudioBuf(const MpBuf &)
Disable copy (and other) constructor.
char * getDataWritePtr()
Return pointer to payload data.
Definition: MpDataBuf.cpp:35
void setSpeechParams(const MpSpeechParams ¶ms)
Set all speech parameters at once.
Definition: MpAudioBuf.h:81
const char * getDataPtr() const
Return pointer to payload data.
Definition: MpDataBuf.cpp:43
unsigned getTimecode() const
Get time code for this frame.
Definition: MpAudioBuf.h:102
void setTimecode(unsigned timecode)
Set time code for this frame.
Definition: MpAudioBuf.h:69
MpArrayBufPtr mpData
Payload data.
Definition: MpDataBuf.h:93
const MpSpeechParams & getSpeechParams() const
Get speech parameters as a structure (const version)
Definition: MpAudioBuf.h:114
#define MPBUFDATA_FROM_BASE_CONSTRUCTOR(classname, buffer_type, base_classname)
This constructor owns MpBuf object.
Definition: MpDataBuf.h:18
MpAudioBuf & operator=(const MpBuf &)
Disable assignment operator.
void setAmplitude(MpAudioSample amplitude)
Set amplitude of the data in the buffer.
Definition: MpAudioBuf.h:72
void setClipping(UtlBoolean clipping)
Is data in the buffer clipped?
Definition: MpAudioBuf.h:75
int getEnergy() const
Get normalized frame energy.
Definition: MpAudioBuf.h:111
MpSpeechParams mParams
Parameters of the frame data.
Definition: MpAudioBuf.h:141
int16_t MpAudioSample
Definition: MpTypes.h:44
static MpBufPool * smpDefaultPool
Default pool for this type of buffer.
Definition: MpAudioBuf.h:43
void init()
This is called in place of constructor.
Definition: MpAudioBuf.cpp:79
MpSpeechType
Type of audio data.
Definition: MpTypes.h:65
int mFrameEnergy
Definition: MpTypes.h:98
Smart pointer to MpAudioBuf.
Definition: MpAudioBuf.h:168
MpAudioSample getAmplitude() const
Get amplitude of the data in the buffer.
Definition: MpAudioBuf.h:105
bool setSamplesNumber(int samplesNum)
Set current number of samples in audio data.
Definition: MpAudioBuf.h:65
UtlBoolean getClipping() const
Is data in the buffer clipped?
Definition: MpAudioBuf.h:108
#define MPBUF_MEMBER_ACCESS_OPERATOR(classname)
Return pointer to buffer.
Definition: MpBuf.h:417
#define MPBUF_CONST_MEMBER_ACCESS_OPERATOR(classname)
Return readonly pointer to buffer.
Definition: MpBuf.h:422
unsigned getSamplesNumber() const
Get current number of samples in audio data.
Definition: MpAudioBuf.h:99
UtlBoolean mIsClipped
Is data in this buffer clipped or not?
Definition: MpTypes.h:97
void setEnergy(int energy)
Set normalized frame energy level.
Definition: MpAudioBuf.h:78
MpSpeechType getSpeechType() const
Get audio data type.
Definition: MpAudioBuf.h:90
void setSpeechType(MpSpeechType type)
Set audio data type.
Definition: MpAudioBuf.h:57
Smart pointer to MpDataBuf.
Definition: MpDataBuf.h:127
Buffer for raw audio data.
Definition: MpAudioBuf.h:36
int compareSamples(const MpAudioBufPtr &frame, unsigned int tolerance=0) const
compare two frames of audio to see if they are the same or similar
Definition: MpAudioBuf.cpp:32
Base class for all media buffers.
Definition: MpBuf.h:74
Begin of the MpAudioBuf type.
Definition: MpBuf.h:50
#define MPBUF_DEFAULT_CONSTRUCTOR(classname)
Default constructor - construct invalid pointer.
Definition: MpBuf.h:387
MpSpeechParams & getSpeechParams()
Get speech parameters as a structure.
Definition: MpAudioBuf.h:117
Pool of buffers.
Definition: MpBufPool.h:32
Stores data in the external buffer.
Definition: MpDataBuf.h:42