sipxmedialib  Version 3.3
Macros | Functions
MpAudioUtils.cpp File Reference
#include <os/OsIntTypes.h>
#include <stdlib.h>
#include <os/OsDefs.h>
#include <os/OsStatus.h>
#include <os/OsFS.h>
#include <mp/MpTypes.h>
#include <mp/MpAudioUtils.h>
#include <mp/MpDspUtils.h>
#include <mp/StreamHttpDataSource.h>
#include <mp/MpAudioWaveFileRead.h>
#include <os/fstream>
Include dependency graph for MpAudioUtils.cpp:

Macros

#define MAX_WAVBUF_SIZE   65535
 

Functions

void ConvertUnsigned8ToSigned16 (unsigned char *in_buffer, MpAudioSample *out_buffer, int numBytesToConvert)
 
int gcd (int a, int b)
 Returns the GCD of a and b. More...
 
int reSample (char *charBuffer, int Size, int CurrentSampleRate, int NewSampleRate)
 Downsamples from current rate to new rate. Doesn't upsample yet. More...
 
int mergeChannels (char *charBuffer, int Size, int nTotalChannels)
 Merges two or more channels into one. More...
 
OsStatus WriteWaveHdr (OsFile &file)
 
OsStatus updateWaveHeaderLengths (OsFile &file)
 
OsStatus mergeWaveUrls (UtlString rSourceUrls[], UtlString &rDestFile)
 Works with 16bit wavs only. (for now) More...
 
OsStatus mergeWaveFiles (UtlString rSourceFiles[], UtlString &rDestFile)
 Works with 16bit wavs only. (for now) More...
 
void InitG711Tables ()
 
size_t DecompressG711MuLaw (MpAudioSample *buffer, size_t length)
 
unsigned char MuLawEncode2 (MpAudioSample s)
 
MpAudioSample MuLawDecode2 (unsigned char ulaw)
 
size_t DecompressG711ALaw (MpAudioSample *buffer, size_t length)
 
unsigned char ALawEncode2 (MpAudioSample s)
 
MpAudioSample ALawDecode2 (unsigned char alaw)
 

Macro Definition Documentation

#define MAX_WAVBUF_SIZE   65535

Function Documentation

void ConvertUnsigned8ToSigned16 ( unsigned char *  in_buffer,
MpAudioSample out_buffer,
int  numBytesToConvert 
)
int gcd ( int  a,
int  b 
)

Returns the GCD of a and b.

Don't pass it negative numbers or (0, 0)

int reSample ( char *  charBuffer,
int  Size,
int  CurrentSampleRate,
int  NewSampleRate 
)

Downsamples from current rate to new rate. Doesn't upsample yet.

int mergeChannels ( char *  charBuffer,
int  Size,
int  nTotalChannels 
)

Merges two or more channels into one.

Takes size in bytes as input. Returns new size in bytes

OsStatus WriteWaveHdr ( OsFile &  file)
OsStatus updateWaveHeaderLengths ( OsFile &  file)
OsStatus mergeWaveUrls ( UtlString  rSourceUrls[],
UtlString &  rDestFile 
)

Works with 16bit wavs only. (for now)

OsStatus mergeWaveFiles ( UtlString  rSourceFiles[],
UtlString &  rDestFile 
)

Works with 16bit wavs only. (for now)

void InitG711Tables ( )
size_t DecompressG711MuLaw ( MpAudioSample buffer,
size_t  length 
)
unsigned char MuLawEncode2 ( MpAudioSample  s)
MpAudioSample MuLawDecode2 ( unsigned char  ulaw)
size_t DecompressG711ALaw ( MpAudioSample buffer,
size_t  length 
)
unsigned char ALawEncode2 ( MpAudioSample  s)
MpAudioSample ALawDecode2 ( unsigned char  alaw)