Sound provider in a raw PCM format (no header in file). More...

#include <soundprovider_raw.h>

+ Inheritance diagram for clan::SoundProvider_Raw:

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. More...
 
virtual ~SoundProvider_Raw ()
 
virtual SoundProvider_Sessionbegin_session () override
 Called by SoundBuffer when a new session starts. More...
 
virtual void end_session (SoundProvider_Session *session) override
 Called by SoundBuffer when a session has finished. After this call,. More...
 
- Public Member Functions inherited from clan::SoundProvider
 SoundProvider ()
 
virtual ~SoundProvider ()
 

Friends

class SoundProvider_Raw_Session
 

Detailed Description

Sound provider in a raw PCM format (no header in file).

Constructor & Destructor Documentation

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.

Parameters
sound_dataRaw PCM data.
num_samplesNumber of samples to be read out of sound_data.
bytes_per_sampleThe size of a sample in bytes. This is 2 for 16 bit (signed), and 1 for 8 bit (unsigned).
stereoTrue if sound is stereo (two channels).
frequencyPlayback frequency for sample data.
virtual clan::SoundProvider_Raw::~SoundProvider_Raw ( )
virtual

Member Function Documentation

virtual SoundProvider_Session* clan::SoundProvider_Raw::begin_session ( )
overridevirtual

Called by SoundBuffer when a new session starts.

Returns
The soundbuffer session to be attached to the newly started session.

Implements clan::SoundProvider.

virtual void clan::SoundProvider_Raw::end_session ( SoundProvider_Session session)
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.

Friends And Related Function Documentation

friend class SoundProvider_Raw_Session
friend

The documentation for this class was generated from the following file: