sipxmedialib  Version 3.3
Functions
MpAudioUtils.h File Reference
#include <os/OsDefs.h>
#include <os/OsStatus.h>
#include <utl/UtlString.h>
#include "mp/MpTypes.h"
Include dependency graph for MpAudioUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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 numBytes, 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 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)
 
size_t DecompressG711ALaw (MpAudioSample *buffer, size_t length)
 
unsigned char ALawEncode2 (MpAudioSample s)
 
unsigned char MuLawEncode2 (MpAudioSample s)
 
MpAudioSample MuLawDecode2 (unsigned char ulaw)
 
MpAudioSample ALawDecode2 (unsigned char alaw)
 

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  numBytes,
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 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 
)
size_t DecompressG711ALaw ( MpAudioSample buffer,
size_t  length 
)
unsigned char ALawEncode2 ( MpAudioSample  s)
unsigned char MuLawEncode2 ( MpAudioSample  s)
MpAudioSample MuLawDecode2 ( unsigned char  ulaw)
MpAudioSample ALawDecode2 ( unsigned char  alaw)