sipxmedialib  Version 3.3
MpAudioUtils.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2004-2006 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
9 // Licensed to SIPfoundry under a Contributor Agreement.
10 //
11 // $$
13 
14 // SYSTEM INCLUDES
15 
16 // APPLICATION INCLUDES
17 #include <os/OsDefs.h>
18 #include <os/OsStatus.h>
19 #include <utl/UtlString.h>
20 #include "mp/MpTypes.h"
21 
22 void ConvertUnsigned8ToSigned16(unsigned char *in_buffer, MpAudioSample *out_buffer, int numBytesToConvert);
23 
25 int gcd(int a, int b);
30 int reSample(char * charBuffer, int numBytes, int currentSampleRate, int newSampleRate);
32 
34 int mergeChannels(char * charBuffer, int Size, int nTotalChannels);
39 #ifndef DISABLE_STREAM_PLAYER
40 
42 OsStatus mergeWaveUrls(UtlString rSourceUrls[], UtlString &rDestFile);
43 
45 OsStatus mergeWaveFiles(UtlString rSourceFiles[], UtlString &rDestFile);
46 
47 #endif // DISABLE_STREAM_PLAYER
48 
49 //routines for compressing & decompressing aLaw and uLaw
50 void InitG711Tables();
51 size_t DecompressG711MuLaw(MpAudioSample *buffer,size_t length);
52 size_t DecompressG711ALaw(MpAudioSample *buffer, size_t length);
53 unsigned char ALawEncode2(MpAudioSample s);
54 unsigned char MuLawEncode2(MpAudioSample s);
55 MpAudioSample MuLawDecode2(unsigned char ulaw);
56 MpAudioSample ALawDecode2(unsigned char alaw);
void InitG711Tables()
Definition: MpAudioUtils.cpp:499
size_t DecompressG711ALaw(MpAudioSample *buffer, size_t length)
Definition: MpAudioUtils.cpp:549
int reSample(char *charBuffer, int numBytes, int currentSampleRate, int newSampleRate)
Downsamples from current rate to new rate. Doesn&#39;t upsample yet.
Definition: MpAudioUtils.cpp:75
void ConvertUnsigned8ToSigned16(unsigned char *in_buffer, MpAudioSample *out_buffer, int numBytesToConvert)
Definition: MpAudioUtils.cpp:52
MpAudioSample MuLawDecode2(unsigned char ulaw)
Definition: MpAudioUtils.cpp:538
OsStatus mergeWaveUrls(UtlString rSourceUrls[], UtlString &rDestFile)
Works with 16bit wavs only. (for now)
Definition: MpAudioUtils.cpp:269
OsStatus mergeWaveFiles(UtlString rSourceFiles[], UtlString &rDestFile)
Works with 16bit wavs only. (for now)
Definition: MpAudioUtils.cpp:395
int16_t MpAudioSample
Definition: MpTypes.h:44
int mergeChannels(char *charBuffer, int Size, int nTotalChannels)
Merges two or more channels into one.
Definition: MpAudioUtils.cpp:105
size_t DecompressG711MuLaw(MpAudioSample *buffer, size_t length)
Definition: MpAudioUtils.cpp:514
int gcd(int a, int b)
Returns the GCD of a and b.
Definition: MpAudioUtils.cpp:60
unsigned char ALawEncode2(MpAudioSample s)
Definition: MpAudioUtils.cpp:559
unsigned char MuLawEncode2(MpAudioSample s)
Definition: MpAudioUtils.cpp:526
MpAudioSample ALawDecode2(unsigned char alaw)
Definition: MpAudioUtils.cpp:570