ssplCreateSoundSpooler

Create a SoundSpooler.

Synopsis

SoundSpooler *ssplCreateSoundSpooler ( int32 NumBuffers, Item SamplerIns )

Description

ssplCreateSoundSpooler() creates a SoundSpooler data structure and initializes it. Call ssplCreateSoundSpooler() first to create a SoundSpooler data structure.

This function allocates the requested number of SoundBufferNodes for the SoundSpooler. SoundBufferNodes simply carry pointers to sample data; they do not have any embedded sample data. The pointer and length of each sample buffer is stored into a SoundBufferNode with ssplSetBufferAddressLength() prior to enqueuing it with ssplSendBuffer().

Arguments

NumBuffers
Specifies the number of buffers. For double buffering of audio data, use NumBuffers=2. The more buffers you use, the less chance you will have of running out of data. A safe number to use is 4-8.
SamplerIns
The DSP instrument that will play the data. For example, you could use a fixedstereosample.dsp instrument to play a 44.1 kHz, 16-bit, stereo soundfile. You can call ScanSample() and SelectSamplePlayer() to determine the best instrument to use for a given sample format. You will need to connect this instrument to a mixer or a direct out.dsp to hear the sound. This setting can be changed after creation by using ssplAttachInstrument(). Also, this can be 0, if you call ssplAttachInstrument() before actually starting the spooler.

Return Value

Pointer to new SoundSpooler on success, or NULL on failure.

Implementation

Library call implemented in music.lib V21.

Caveats

If this function fails, it messes up subsequent sequence numbering.

Associated Files

soundspooler.h, music.lib

See Also

ssplDeleteSoundSpooler(), ssplStartSpooler(), ssplSendBuffer(), ssplProcessSignals()