deBaseSoundDecoder Class Reference

Base Sound Decoder. More...

#include <deBaseSoundDecoder.h>

List of all members.

Public Member Functions

Constructors and Destructors
 deBaseSoundDecoder (decBaseFileReader *file)
 Creates a new sound stream object.
virtual ~deBaseSoundDecoder ()
 Cleans up the sound stream object.
Management
decBaseFileReaderGetFile () const
 Retrieves the file.
virtual int GetBytesPerSample () const =0
 Retrieves the bytes per sample.
virtual int GetSampleCount () const =0
 Retrieves the number of samples.
virtual int GetChannelCount () const =0
 Retrieves the number of channels.
virtual int GetSampleRate () const =0
 Retrieves the sample rate.
virtual int GetPosition ()=0
 Retrieves the position in samples.
virtual void SetPosition (int position)=0
 Sets the position in samples from the beginning.
virtual int ReadSamples (void *buffer, int size)=0
 Reads a chunk of sound data from the file.

Detailed Description

Base Sound Decoder.

Sound decoders allow to decode sound data from a file reader. The decoding can be done over time. The file reader is held open as long as the decoder exists. The sound informations are provided using virtual functions. Although possible to do different the same values have to be returned during the entire lifetime of the decoder since modules expect this values to be unchangable. The position is measured in samples from the beginning of the file and behaves like a file pointer.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deBaseSoundDecoder::deBaseSoundDecoder ( decBaseFileReader file )

Creates a new sound stream object.

virtual deBaseSoundDecoder::~deBaseSoundDecoder (  ) [virtual]

Cleans up the sound stream object.


Member Function Documentation

virtual int deBaseSoundDecoder::GetBytesPerSample (  ) const [pure virtual]

Retrieves the bytes per sample.

virtual int deBaseSoundDecoder::GetChannelCount (  ) const [pure virtual]

Retrieves the number of channels.

decBaseFileReader* deBaseSoundDecoder::GetFile (  ) const [inline]

Retrieves the file.

virtual int deBaseSoundDecoder::GetPosition (  ) [pure virtual]

Retrieves the position in samples.

virtual int deBaseSoundDecoder::GetSampleCount (  ) const [pure virtual]

Retrieves the number of samples.

virtual int deBaseSoundDecoder::GetSampleRate (  ) const [pure virtual]

Retrieves the sample rate.

virtual int deBaseSoundDecoder::ReadSamples ( void *  buffer,
int  size 
) [pure virtual]

Reads a chunk of sound data from the file.

Reads the given number of sample bytes into the provided buffer and advances the position. Returns the number of bytes written to the buffer. This can be less than the requested amount if the end of file has been reached. An error is signaled using the engine error signaling and 0 returned.

virtual void deBaseSoundDecoder::SetPosition ( int  position ) [pure virtual]

Sets the position in samples from the beginning.


The documentation for this class was generated from the following file: