sipxmedialib
Version 3.3
|
Buffer for raw audio data. More...
#include <MpAudioBuf.h>
Public Member Functions | |
Manipulators | |
void | setSpeechType (MpSpeechType type) |
Set audio data type. More... | |
bool | setSamplesNumber (int samplesNum) |
Set current number of samples in audio data. More... | |
void | setTimecode (unsigned timecode) |
Set time code for this frame. More... | |
void | setAmplitude (MpAudioSample amplitude) |
Set amplitude of the data in the buffer. More... | |
void | setClipping (UtlBoolean clipping) |
Is data in the buffer clipped? More... | |
void | setEnergy (int energy) |
Set normalized frame energy level. More... | |
void | setSpeechParams (const MpSpeechParams ¶ms) |
Set all speech parameters at once. More... | |
Accessors | |
MpSpeechType | getSpeechType () const |
Get audio data type. More... | |
const MpAudioSample * | getSamplesPtr () const |
Get pointer to audio data. More... | |
MpAudioSample * | getSamplesWritePtr () |
Get writable pointer to audio data. More... | |
unsigned | getSamplesNumber () const |
Get current number of samples in audio data. More... | |
unsigned | getTimecode () const |
Get time code for this frame. More... | |
MpAudioSample | getAmplitude () const |
Get amplitude of the data in the buffer. More... | |
UtlBoolean | getClipping () const |
Is data in the buffer clipped? More... | |
int | getEnergy () const |
Get normalized frame energy. More... | |
const MpSpeechParams & | getSpeechParams () const |
Get speech parameters as a structure (const version) More... | |
MpSpeechParams & | getSpeechParams () |
Get speech parameters as a structure. More... | |
Inquiry | |
int | compareSamples (const MpAudioBufPtr &frame, unsigned int tolerance=0) const |
compare two frames of audio to see if they are the same or similar More... | |
Public Member Functions inherited from MpDataBuf | |
void | setData (const MpArrayBufPtr &pData) |
Set new payload data. More... | |
char * | getDataWritePtr () |
Return pointer to payload data. More... | |
const char * | getDataPtr () const |
Return pointer to payload data. More... | |
MpArrayBufPtr | getData () const |
Get payload data. More... | |
Public Member Functions inherited from MpBuf | |
void | attach () |
Increments reference counter. More... | |
void | detach () |
Decrements reference counter and free buffer if needed. More... | |
void | setFlowGraph (MpFlowGraphBase *flowgraph) |
MP_BUFFERS_TREE | getType () const |
Get buffer type. More... | |
MpBufPool * | getBufferPool () const |
Get parent pool of this buffer. More... | |
Static Public Attributes | |
static MpBufPool * | smpDefaultPool = NULL |
Default pool for this type of buffer. More... | |
Static Public Attributes inherited from MpDataBuf | |
static MpBufPool * | smpDefaultPool = NULL |
Default pool for MpDataBuf objects. More... | |
Protected Member Functions | |
void | init () |
This is called in place of constructor. More... | |
Protected Member Functions inherited from MpDataBuf | |
void | init () |
This is called in place of constructor. More... | |
Protected Attributes | |
MpSpeechParams | mParams |
Parameters of the frame data. More... | |
Protected Attributes inherited from MpDataBuf | |
MpArrayBufPtr | mpData |
Payload data. More... | |
Protected Attributes inherited from MpBuf | |
MP_BUFFERS_TREE | mType |
Buffer class type. Used for type safety. More... | |
int | mRefCounter |
Reference counter for use with MpBufPtr. More... | |
MpBufPool * | mpPool |
Parent memory pool. More... | |
MpFlowGraphBase * | mpFlowGraph |
Debug pointer to flowgraph in which this buf is used. More... | |
void(* | mpDestroy )(MpBuf *) |
void(* | mpInitClone )(MpBuf *) |
Private Member Functions | |
MpAudioBuf (const MpBuf &) | |
Disable copy (and other) constructor. More... | |
MpAudioBuf & | operator= (const MpBuf &) |
Disable assignment operator. More... | |
Friends | |
class | MpAudioBufPtr |
Additional Inherited Members | |
Static Protected Member Functions inherited from MpDataBuf | |
static void | sDestroy (MpBuf *pBuffer) |
Destructor for MpDataBuf. More... | |
static void | sInitClone (MpBuf *pBuffer) |
Function that initialize buffer after cloning. It makes clone of mpData. More... | |
Static Protected Member Functions inherited from MpBuf | |
static void | sInitClone (MpBuf *pBuffer) |
Function that initialize buffer after cloning. It adjusts reference counters. More... | |
Buffer for raw audio data.
This is only the header for audio data. It contain some speech-related parameters and pointer to external data (cause it is based on MpDataBuf).
|
private |
Disable copy (and other) constructor.
This struct will be initialized by init() member.
|
inline |
Set audio data type.
|
inline |
Set current number of samples in audio data.
Set data size with MpAudioSample size kept in mind.
|
inline |
Set time code for this frame.
|
inline |
Set amplitude of the data in the buffer.
|
inline |
Is data in the buffer clipped?
|
inline |
Set normalized frame energy level.
|
inline |
Set all speech parameters at once.
|
inline |
Get audio data type.
|
inline |
Get pointer to audio data.
|
inline |
Get writable pointer to audio data.
|
inline |
Get current number of samples in audio data.
|
inline |
Get time code for this frame.
|
inline |
Get amplitude of the data in the buffer.
|
inline |
Is data in the buffer clipped?
|
inline |
Get normalized frame energy.
|
inline |
Get speech parameters as a structure (const version)
|
inline |
Get speech parameters as a structure.
int compareSamples | ( | const MpAudioBufPtr & | frame, |
unsigned int | tolerance = 0 |
||
) | const |
compare two frames of audio to see if they are the same or similar
tolerance | - the allowed difference between the corresponding samples in the two frames which are considered to still be the same. |
|
protected |
This is called in place of constructor.
|
private |
Disable assignment operator.
Buffers may be copied. But do we need this?
|
friend |
|
static |
Default pool for this type of buffer.
|
protected |
Parameters of the frame data.