Drag[en]gine Game Engine  1.0
deBaseSoundDecoder Class Referenceabstract

Base Sound Decoder. More...

#include <deBaseSoundDecoder.h>

Public Member Functions

Constructors and Destructors
 deBaseSoundDecoder (decBaseFileReader *file)
virtual ~deBaseSoundDecoder ()
decBaseFileReaderGetFile () const
virtual int GetBytesPerSample () const =0
virtual int GetSampleCount () const =0
virtual int GetChannelCount () const =0
virtual int GetSampleRate () const =0
virtual int GetPosition ()=0
virtual void SetPosition (int position)=0
virtual int ReadSamples (void *buffer, int size)=0

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.

Pl├╝ss Roland

Constructor & Destructor Documentation

◆ deBaseSoundDecoder()

deBaseSoundDecoder::deBaseSoundDecoder ( decBaseFileReader file)

Creates a new sound stream object.

◆ ~deBaseSoundDecoder()

virtual deBaseSoundDecoder::~deBaseSoundDecoder ( )

Cleans up the sound stream object.

Member Function Documentation

◆ GetBytesPerSample()

virtual int deBaseSoundDecoder::GetBytesPerSample ( ) const
pure virtual

Retrieves the bytes per sample.

Referenced by GetFile().

◆ GetChannelCount()

virtual int deBaseSoundDecoder::GetChannelCount ( ) const
pure virtual

Retrieves the number of channels.

Referenced by GetFile().

◆ GetFile()

decBaseFileReader* deBaseSoundDecoder::GetFile ( ) const

◆ GetPosition()

virtual int deBaseSoundDecoder::GetPosition ( )
pure virtual

Retrieves the position in samples.

Referenced by GetFile().

◆ GetSampleCount()

virtual int deBaseSoundDecoder::GetSampleCount ( ) const
pure virtual

Retrieves the number of samples.

Referenced by GetFile().

◆ GetSampleRate()

virtual int deBaseSoundDecoder::GetSampleRate ( ) const
pure virtual

Retrieves the sample rate.

Referenced by GetFile().

◆ ReadSamples()

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.

Referenced by GetFile().

◆ SetPosition()

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

Sets the position in samples from the beginning.

Referenced by GetFile().

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