ClanSoft logo
ClanSoft logo

    CL_SoundBuffer

Sample interface in ClanLib.

Description

The CL_SoundBuffer class represents a sample in ClanLib. It can either be static or streamed. The soundbuffer gets its sample data from a soundprovider, that is passed during construction.

A static sample are normally sound effects and other sounds, that do not change. ClanLib will always load the entire sample into memory, and possibly upload it to the soundcard.

Streamed samples are either large sample that should be loaded a bit at a time (music for instance), or sounds that change from playback to playback (a microphone, speech over the net, etc).

Class members

virtual ~CL_SoundBuffer()
static CL_SoundBuffer *create( CL_StaticSoundProvider *provider, bool delete_provider=false)
static CL_SoundBuffer *create( CL_StreamSoundProvider *provider, bool delete_provider=false)
virtual CL_StaticSoundProvider *get_static_provider()
virtual CL_StreamSoundProvider *get_stream_provider()
virtual int get_length()
virtual int get_num_samples()
virtual int get_frequency()
virtual bool set_frequency(int new_freq)
virtual float get_volume()
virtual bool set_volume(float new_volume)
virtual float get_pan()
virtual bool set_pan(float new_pan)
virtual bool is_playing( CL_SoundBuffer_Session **session=NULL, CL_SoundCard *card=NULL)
virtual void stop(CL_SoundCard *card=NULL)
virtual CL_SoundBuffer_Session play( bool looping=false, CL_SoundCard *card=NULL)
virtual CL_SoundBuffer_Session prepare( bool looping=false, CL_SoundCard *card=NULL)

See Also

CL_StaticSoundProvider-Static sample data source.
CL_StreamSoundProvider-Streamed sample data source.
CL_SoundBuffer_Session-Sample playback control.

Back to index



This page was built using the Perceps documentation system.