|
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 *load(
const char *res_id,
CL_ResourceManager *manager)
static CL_SoundBuffer *create(
CL_StaticSoundProvider *provider,
bool delete_provider=false)
static CL_SoundBuffer *create(
CL_StreamSoundProvider *provider,
bool delete_provider=false)
CL_SoundBuffer(
const char *res_id,
CL_ResourceManager *manager)
CL_SoundBuffer(
CL_StaticSoundProvider *provider,
bool delete_provider=false,
class CL_Resource *resource = NULL)
CL_SoundBuffer(
CL_StreamSoundProvider *provider,
bool delete_provider=false,
class CL_Resource *resource = NULL)
CL_SoundBuffer(const CL_SoundBuffer ©)
CL_StaticSoundProvider *get_static_provider()
CL_StreamSoundProvider *get_stream_provider()
int get_length()
int get_num_samples()
int get_frequency()
bool set_frequency(int new_freq)
float get_volume()
bool set_volume(float new_volume)
float get_pan()
bool set_pan(float new_pan)
bool is_playing(
CL_SoundBuffer_Session **session=NULL,
CL_SoundCard *card=NULL)
void stop(CL_SoundCard *card=NULL)
CL_SoundBuffer_Session play(
bool looping=false,
CL_SoundCard *card=NULL)
CL_SoundBuffer_Session prepare(
bool looping=false,
CL_SoundCard *card=NULL)
class CL_SoundBuffer_Generic *impl
See Also
| CL_StaticSoundProvider | - | Static sample data source. |
| CL_StreamSoundProvider | - | Streamed sample data source. |
| CL_SoundBuffer_Session | - | Sample playback control. |
Back to index
|