Simple Sound for Small Devices
last updated: 03 JUN 2003 (v0.6)

Function Name: sssd_registerSample
   Register a sample already in memory with sssd.   The sample data may not be freed after registering as sssd does not make a copy.  The sample must also be in the same format as the player (bits, channels, frequency.)   This function can be used for dynamic samples.  

C Prototype:

int sssd_registerSample( struct sssdaudio* ga,void *sampledata, int channels, int freq, int bits, int samples, int flags);

  Other Prototypes:


struct gameaudio *ga

    Pointer to an initialized sssdaudio structure (returned by sssd_initAudio)

void *sampledata

    Pointer to the digital audio sample data.  (Must be unsigned 8-bit or signed 16-bit.)

int channels

    Number of channels present in the sample data (currently only 1 or 2 for mono or stereo are supported)

int frequency

    Sample frequency of the sound data. (See also frequency hints)

int bits

    Number of bits per sample value (currently only 8 and 16 are supported)

int samples

    Number of samples in the sample data.  (sometimes called 'frames')

int flags

A series of or'ed {|} flags

    Override sample parameters: LOAD_RIGHT, LOAD_LEFT will blank the left or the right channel ONLY when the sample is first registered.  If the sample is dynamic and software fills the buffer with new sample data, sssd will not blank the channel again.   These should be used when you want a sample to pan.


    Successful copy returns the sample_id of the sample.  This ID number is used to control and play the sample.

    SSSD system has not been initialized.

    No open sample slots are available to create a new SSSD sample.

libsssd (c)2003 Patrick Roberts created from libgaudio (c) 1999-2000 A. Schiffler.  Release as open source under MPL 1.1.  Documentation (c)2003 Patrick Roberts.