FSOUND_DSPUNIT *F_API FSOUND_DSP_Create(
FSOUND_DSPCALLBACK callback,
int priority,
void *userdata
);
callback | This is a pointer to your DSP Unit callback, of type FSOUND_DSPCALLBACK. The prototype for a callback is declared in the following fashion. Callbacks must return a pointer to the buffer you work on, so that the next dsp unit can work on it. Here is the simplest case: void *callback(void *originalbuffer, void *newbuffer, int length, void *userdata) { // originalbuffer = fsounds original mixbuffer. // newbuffer = the buffer passed from the previous DSP unit. // length = length in samples at this mix time. // param = user parameter passed through in FSOUND_DSP_Create. // // modify the buffer in some fashion return newbuffer; } See the definition of FSOUND_DSPCALLBACK for more. |
priority | Order in the priority chain. Valid numbers are 0 to 1000, 0 being highest priority (first), with 1000 being lowest priority (last). Note that FSOUNDs soundeffects mixers and copy routines are considered part of this DSP unit chain which you can play with. |
param | User defined parameter, this gets passed into the callback when it is called. It is safe to leave this value 0. |