Home | All Classes | Grouped Classes | Index | Search

Class CL_SoundBuffer

Sample interface in ClanLib. More...

Derived from: none
Derived by: none
Group: Sound (Audio Mixing)

#include <ClanLib/sound.h>

Construction:

CL_SoundBuffer

Construct sound buffer.

Operators:

operator =

Copy assignment.

Attributes:

get_static_provider

Returns the static soundprovider attached or NULL if it is a streamed sound buffer.

get_stream_provider

Return the streamed soundprovider attached or NULL if it is a static sound buffer.

get_length

Returns the length of the soundbuffer. That is num_samples * bytes_per_sample.

get_num_samples

Returns the number of samples in the soundbuffer.

get_frequency

Returns the start frequency used when the buffer is played.

Operations:

set_frequency

Sets the start frequency used when the buffer is played.

get_volume

Returns the start/default volume used when the buffer is played.

set_volume

Sets the default volume used when the buffer is played.

get_pan

Returns the default panning position when the buffer is played.

set_pan

Sets the default panning position when the buffer is played.

is_playing

Returns true if an instance of this soundbuffer is playing

stop

Stops any sessions playing this soundbuffer

play

Plays the soundbuffer on the specified soundcard and using the specified playback description.

prepare

Prepares the soundbuffer for playback on the specified soundcard.

Implementation:

impl

resource

Detailed 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).



Questions or comments, write to the
ClanLib mailing list.