Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_Streamed_WaveSample

Streamed sample in wave (.wav) format.
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`, `CL_InputSourceProvider`* `inputprovider` = NULL, `bool` `looped` = false)`;
`` | `CL_Streamed_WaveSample` | `(`const` `std::string`& `filename`, `CL_InputSourceProvider`* `inputprovider` = NULL, `bool` `looped` = false)`;
``virtual`` | `~CL_Streamed_WaveSample` | `()`;

### Operations:

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

## Description:

This class providers playback support for wave (.wav) samples.
Unlike CL_Sample, 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 instead.
See Also - CL_Sample - The static wave sample provider.
See Also - CL_Sample_Raw - The static raw sample provider.
See Also - CL_Streamed_RawSample - The streamed raw 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_WaveSample::CL_Streamed_WaveSample - Constructs an instance of this class.
`` `CL_Streamed_WaveSample` `(`const` `std::string`& `filename`, `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_WaveSample::begin_session - Called by the sound implementation when a session is begun.
``virtual` `CL_StreamSoundProvider_Session`*` `begin_session` `()`;

CL_Streamed_WaveSample::create - Creates a soundbuffer using this provider.
``static` `CL_SoundBuffer`*` `create` `(`const` `std::string`& `filename`, `CL_InputSourceProvider`* `inputprovider` = NULL, `bool` `looped` = false)`;

> filename - Filename of the wave file.
> 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_WaveSample::end_session - Called by the sound implementation just before a playback session has
ended.
``virtual` `void`` `end_session` `(`CL_StreamSoundProvider_Session`* `session`)`;

CL_Streamed_WaveSample::~CL_Streamed_WaveSample - Streamed Wave Sample Destructor
``virtual`` `~CL_Streamed_WaveSample` `()`;

## Variable Member Descriptions: