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

#include <mpau.h>

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

Public Types

enum  AuDecompressionType { DeG711MuLaw = 1, DePcm8Unsigned, DePcm16MsbSigned }
 

Public Member Functions

 MpAuRead (istream &s, int raw=0)
 
 ~MpAuRead ()
 
size_t getSamples (AudioSample *buffer, size_t numSamples)
 Returns number of samples actually read, 0 on error. More...
 
size_t readBytes (AudioByte *buffer, size_t length)
 read length of bytes More...
 
int getDecompressionType ()
 get decompression type of the audio file More...
 
size_t getBytesSize ()
 get bytes size 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...
 

Protected 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...
 

Private Member Functions

void ReadHeader (void)
 

Private Attributes

istream & mStream
 
int m_CompressionType
 
AbstractDecompressor_decoder
 
size_t _dataLength
 
bool _headerRead
 true if header has already been read More...
 
int _headerChannels
 channels from header More...
 
int _headerRate
 sampling rate from header More...
 

Additional Inherited Members

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

Member Enumeration Documentation

Enumerator
DeG711MuLaw 
DePcm8Unsigned 
DePcm16MsbSigned 

Constructor & Destructor Documentation

MpAuRead ( istream &  s,
int  raw = 0 
)
~MpAuRead ( )
inline

Member Function Documentation

size_t getSamples ( AudioSample ,
size_t   
)
inlinevirtual

Returns number of samples actually read, 0 on error.

Implements MpAudioAbstract.

size_t readBytes ( AudioByte buff,
size_t  length 
)
virtual

read length of bytes

Reimplemented from MpAudioAbstract.

int getDecompressionType ( )
inlinevirtual

get decompression type of the audio file

Reimplemented from MpAudioAbstract.

size_t getBytesSize ( )
virtual

get bytes size of the audio file

Reimplemented from MpAudioAbstract.

void ReadHeader ( void  )
private
void minMaxSamplingRate ( long *  min,
long *  max,
long *  prefer 
)
inlineprotectedvirtual

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

Reimplemented from MpAudioAbstract.

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

Get prefered channel.

Reimplemented from MpAudioAbstract.

Member Data Documentation

istream& mStream
private
int m_CompressionType
private
AbstractDecompressor* _decoder
private
size_t _dataLength
private
bool _headerRead
private

true if header has already been read

int _headerChannels
private

channels from header

int _headerRate
private

sampling rate from header