sipxmedialib  Version 3.3
Public Types | Private Member Functions | Private Attributes | List of all members
MpAudioWaveFileRead Class Reference

#include <MpAudioWaveFileRead.h>

Inheritance diagram for MpAudioWaveFileRead:
Inheritance graph
[legend]
Collaboration diagram for MpAudioWaveFileRead:
Collaboration graph
[legend]

Public Types

enum  WaveDecompressionType {
  DePcm8Unsigned = 1, DePcm16LsbSigned, DeG711ALaw = 6, DeG711MuLaw = 7,
  DeImaAdpcm = 17
}
 

Public Member Functions

Creators
 MpAudioWaveFileRead (istream &s)
 Constructor form a stream. More...
 
 ~MpAudioWaveFileRead ()
 Destructor. More...
 
Manipulators
size_t readBytes (AudioByte *buffer, size_t numSamples)
 read length of bytes More...
 
size_t getBytesSize ()
 get bytes size of the audio file More...
 
int getDecompressionType ()
 get decompression type of the audio file More...
 
- Public Member Functions inherited from MpAudioAbstract
 MpAudioAbstract (void)
 Default Constructor. More...
 
 MpAudioAbstract (MpAudioAbstract *audio)
 Copy Constructor. More...
 
virtual ~MpAudioAbstract ()
 Destructor. More...
 
MpAudioAbstractgetPreviousAudio (void)
 get previous audio More...
 
void setPreviousAudio (MpAudioAbstract *a)
 set previous audio to a More...
 
MpAudioAbstractgetNextAudio (void)
 get next audio More...
 
void setNextAudio (MpAudioAbstract *a)
 set next audio to a More...
 
virtual void setSamplingRate (long s)
 Set the sampling rate to s. More...
 
virtual void setSamplingRateRecursive (long s)
 Set sampling rate recursively. More...
 
virtual void negotiateSamplingRate (void)
 negotiate the sampling rate More...
 
virtual long getSamplingRate (void)
 Return the sampling rate. More...
 
virtual void setChannels (int ch)
 Set channel to ch. More...
 
virtual void setChannelsRecursive (int s)
 Set channel recusively. More...
 
virtual void negotiateChannels (void)
 negotiate channel More...
 
virtual int getChannels (void)
 Return the channels. More...
 
virtual void setAudioFormat (int type)
 Set audio object format. More...
 
virtual int getAudioFormat ()
 Get audio object format. More...
 
bool isOk ()
 Return true if file loaded ok. More...
 

Private Member Functions

void minMaxSamplingRate (long *min, long *max, long *preferred)
 TODO: the meaning of this function, get the prefered Sampling rate. More...
 
void minMaxChannels (int *min, int *max, int *preferred)
 Get prefered channel. More...
 
size_t getSamples (AudioSample *buffer, size_t numSamples)
 Returns number of samples actually read, 0 on error. More...
 
void initializeDecompression ()
 
void nextChunk (void)
 Get next chunk for chunk management. More...
 

Private Attributes

istream & mStream
 
AbstractDecompressor_decoder
 Current decompressor. More...
 
unsigned char * mpformatData
 Contents of fmt chunk. More...
 
unsigned long mformatDataLength
 length of fmt chunk More...
 
struct {
   unsigned long   type
 Type of chunk. More...
 
   unsigned long   size
 Size of chunk. More...
 
   unsigned long   remaining
 Bytes left to read. More...
 
   bool   isContainer
 true if this is a container More...
 
   unsigned long   containerType
 type of container More...
 
_chunk [5]
 
int _currentChunk
 top of stack More...
 
unsigned long mFileSize
 

Additional Inherited Members

- Protected Attributes inherited from MpAudioAbstract
bool mbIsOk
 If file loaded ok. More...
 

Member Enumeration Documentation

Enumerator
DePcm8Unsigned 
DePcm16LsbSigned 
DeG711ALaw 
DeG711MuLaw 
DeImaAdpcm 

Constructor & Destructor Documentation

MpAudioWaveFileRead ( istream &  s)

Constructor form a stream.

Destructor.

Member Function Documentation

size_t readBytes ( AudioByte buff,
size_t  length 
)
virtual

read length of bytes

Reimplemented from MpAudioAbstract.

size_t getBytesSize ( )
virtual

get bytes size of the audio file

Reimplemented from MpAudioAbstract.

int getDecompressionType ( )
virtual

get decompression type of the audio file

Reimplemented from MpAudioAbstract.

void minMaxSamplingRate ( long *  min,
long *  max,
long *  prefer 
)
privatevirtual

TODO: the meaning of this function, get the prefered Sampling rate.

Reimplemented from MpAudioAbstract.

void minMaxChannels ( int *  min,
int *  max,
int *  preferred 
)
privatevirtual

Get prefered channel.

Reimplemented from MpAudioAbstract.

size_t getSamples ( AudioSample ,
size_t   
)
privatevirtual

Returns number of samples actually read, 0 on error.

Implements MpAudioAbstract.

void initializeDecompression ( )
private
void nextChunk ( void  )
private

Get next chunk for chunk management.

Member Data Documentation

istream& mStream
private
AbstractDecompressor* _decoder
private

Current decompressor.

unsigned char* mpformatData
private

Contents of fmt chunk.

unsigned long mformatDataLength
private

length of fmt chunk

unsigned long type

Type of chunk.

unsigned long size

Size of chunk.

unsigned long remaining

Bytes left to read.

bool isContainer

true if this is a container

unsigned long containerType

type of container

struct { ... } _chunk[5]
int _currentChunk
private

top of stack

unsigned long mFileSize
private