SPKitWriter is connected to its input object and output soundfile with the setInputOutput(SPKitProcessor* ip, char* sf) function, where ip is a pointer to the input object and sf is the name of the output soundfile. setInputOutput() opens the soundfile for writing. It overwrites an existing file by the same name as in sf.
SPKitWriter writes the audio samples with either the run() or runFor(SPKitInt nSamples) function. run() writes all samples in one loop, while runFor() writes in batches on nSamples per call. runFor return the number of samples written.
Here is an example.
The SPKit distribution includes three different versions of SPKitWriter for differenting operating systems. Choise of these is made when SPKit is compiled. The "generic" version can be compiled and run on all platforms, but it supports only the NeXT/Sun sound file format. A version for the Audio File Library can be used on Linux and other systems that have Audio File Library installed (see http://www.68k.org/~michael/audiofile/). An SGI version is provided for old SGI Irix systems.
The current implementation of SPKitWriter supports only 16-bit integer audio files.
SPKitWriter defines run() and runFor() functions for writing audio samples into a soundfile. SPKitWriter also defines a setInputOutput() function for connecting the object to its input object and output soundfile.
The setInput() and getSample() functions defined in SPKitProcessor should not be used with SPKitWriter.
Sets input to ip.
Calls SPKitProcessor::setInput().
Author: Kai Lassfolk