Cafu Engine
SoundStreamT Class Referenceabstract

Represents a 16 Bit encoded mono or stereo raw PCM data stream. More...

#include "SoundStream.hpp"

Inheritance diagram for SoundStreamT:

Public Member Functions

virtual int Read (unsigned char *Buffer, unsigned int Size)=0
 Reads an amount of bytes from the stream and writes them into the buffer. More...
 
virtual bool Rewind ()=0
 Sets the stream back to the beginning. More...
 
virtual unsigned int GetChannels ()=0
 Returns the number of channels in the current stream. More...
 
virtual unsigned int GetRate ()=0
 Get the sampling rate of this stream. More...
 
virtual ~SoundStreamT ()
 Virtual destructor to make sure the destructor of the derived class is called. More...
 

Static Public Member Functions

static SoundStreamTCreate (const std::string &ResName)
 Creates a new sound stream for the specified resource. More...
 

Detailed Description

Represents a 16 Bit encoded mono or stereo raw PCM data stream.

Constructor & Destructor Documentation

virtual SoundStreamT::~SoundStreamT ( )
inlinevirtual

Virtual destructor to make sure the destructor of the derived class is called.

Member Function Documentation

SoundStreamT * SoundStreamT::Create ( const std::string &  ResName)
static

Creates a new sound stream for the specified resource.

Parameters
ResNameThe name of the stream resource. ResName can be a file name or the name of an OpenAL capture device (as obtained from the ALC_CAPTURE_DEVICE_SPECIFIER list).
Returns
the created sound stream instance. Throws an exception of type std::runtime_error on failure.
virtual unsigned int SoundStreamT::GetChannels ( )
pure virtual

Returns the number of channels in the current stream.

Returns
Number of channels in the stream.

Implemented in OggVorbisStreamT, MP3StreamT, and CaptureStreamT.

virtual unsigned int SoundStreamT::GetRate ( )
pure virtual

Get the sampling rate of this stream.

Returns
The sampling rate in Hz.

Implemented in OggVorbisStreamT, MP3StreamT, and CaptureStreamT.

virtual int SoundStreamT::Read ( unsigned char *  Buffer,
unsigned int  Size 
)
pure virtual

Reads an amount of bytes from the stream and writes them into the buffer.

Parameters
BufferBuffer to write the data into.
SizeAmount of bytes to be read from the stream and write in the buffer.
Returns
Number of bytes wrote into the buffer. -1 if an error occured during reading.

Implemented in OggVorbisStreamT, MP3StreamT, and CaptureStreamT.

virtual bool SoundStreamT::Rewind ( )
pure virtual

Sets the stream back to the beginning.

Implemented in OggVorbisStreamT, MP3StreamT, and CaptureStreamT.


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