ClanSoft logo
ClanSoft logo
Entire Class Index Main Class Index Cross Index Global Index

Class CL_Streamed_RawSample

Streamed sample in raw PCM format (no header).
Contained in: global
Derived from: CL_StreamSoundProvider
Derived by: none
Group: Sound (Sound Providers)

#include <ClanLib/sound.h>


public function member index:

Construction:

static CL_SoundBuffer* create(const std::string& filename, SoundFormat format, int frequency, CL_InputSourceProvider* inputprovider = NULL, bool looped = false);
CL_Streamed_RawSample(const std::string& filename, SoundFormat format, int frequency, CL_InputSourceProvider* inputprovider = NULL, bool looped = false);
virtual ~CL_Streamed_RawSample();

Operations:

virtual CL_StreamSoundProvider_Session* begin_session();
virtual void end_session(CL_StreamSoundProvider_Session* session);
 

Description:

This class providers playback support for raw PCM samples. That is just the PCM sample data, not header.

Unlike CL_Sample_Raw, this class doesn't load the entire PCM stream into memory. Instead it slowly loads it from disk as the data is needed. With very large samples, this is a very good idea.

If the sample is small and used a lot, you should consider using CL_Sample_Raw instead.
See Also - CL_Sample_Raw - The static raw sample provider.
See Also - CL_Sample - The static wave sample provider.
See Also - CL_Streamed_WaveSample - The streamed wave sample provider.
See Also - CL_SoundBuffer - Sound playback class in ClanLib.
See Also - CL_StreamSoundProvider - Streamed sound provider interface.
See Also - CL_StaticSoundProvider - Static sound provider interface.


Function Member Descriptions:

CL_Streamed_RawSample::CL_Streamed_RawSample - Constructs an instance of this class.
CL_Streamed_RawSample(const std::string& filename, SoundFormat format, int frequency, CL_InputSourceProvider* inputprovider = NULL, bool looped = false);
filename - Filename of the raw PCM stream.
frequency - Default playback frequency.
inputprovider - Input source (datafile, regular file). If NULL
it defaults to a regular file.
looped - True if the streamed should be looped (stream never ends).



CL_Streamed_RawSample::begin_session - Called by the sound implementation when a session is begun.
virtual CL_StreamSoundProvider_Session* begin_session();


CL_Streamed_RawSample::create - Creates a soundbuffer using this provider.
static CL_SoundBuffer* create(const std::string& filename, SoundFormat format, int frequency, CL_InputSourceProvider* inputprovider = NULL, bool looped = false);
filename - Filename of the raw PCM stream.
frequency - Default playback frequency.
inputprovider - Input source (datafile, regular file). If NULL
it defaults to a regular file.
looped - True if the streamed should be looped (stream never ends).
Returns - The soundbuffer created.



CL_Streamed_RawSample::end_session - Called by the sound implementation just before a playback session has
ended.
virtual void end_session(CL_StreamSoundProvider_Session* session);


CL_Streamed_RawSample::~CL_Streamed_RawSample - Streamed Raw Sample Destructor
virtual ~CL_Streamed_RawSample();



Variable Member Descriptions: