Sound provider in a raw PCM format (no header in file). More...
#include <soundprovider_raw.h>
Public Member Functions | |
SoundProvider_Raw (void *sound_data, int num_samples, int bytes_per_sample, bool stereo, int frequency=22050) | |
Constructs a sound provider based on some raw PCM data. | |
~SoundProvider_Raw () override | |
SoundProvider_Session * | begin_session () override |
Called by SoundBuffer when a new session starts. | |
void | end_session (SoundProvider_Session *session) override |
Called by SoundBuffer when a session has finished. After this call,. | |
![]() | |
SoundProvider () | |
virtual | ~SoundProvider () |
Friends | |
class | SoundProvider_Raw_Session |
Sound provider in a raw PCM format (no header in file).
clan::SoundProvider_Raw::SoundProvider_Raw | ( | void * | sound_data, |
int | num_samples, | ||
int | bytes_per_sample, | ||
bool | stereo, | ||
int | frequency = 22050 ) |
Constructs a sound provider based on some raw PCM data.
sound_data | Raw PCM data. |
num_samples | Number of samples to be read out of sound_data. |
bytes_per_sample | The size of a sample in bytes. This is 2 for 16 bit (signed), and 1 for 8 bit (unsigned). |
stereo | True if sound is stereo (two channels). |
frequency | Playback frequency for sample data. |
References clan::frequency.
|
override |
|
overridevirtual |
Called by SoundBuffer when a new session starts.
Implements clan::SoundProvider.
|
overridevirtual |
Called by SoundBuffer when a session has finished. After this call,.
SoundBuffer will not access the session anymore. It can safely be deleted here (and in most cases should be delete here).
Implements clan::SoundProvider.
|
friend |
References SoundProvider_Raw_Session.
Referenced by SoundProvider_Raw_Session.