0
0

hi all,
can any one give me a piece of c++ code to load winamp dsp plugins and send the sample to fmod.
Thanks

  • You must to post comments
0
0

you should have a look at the winamp sdk, there you see how any dsp plugin ‘s interface looks like.
then you can use it, hopefully.

  • You must to post comments
0
0

Here is the dsp callback function :

/*———————————————————————————-

This callback is used to fill the buffer of pcmData.
Note : it works pretty good with almost all the dsp plugin i have tested (dfx, ohm force, dee, decisoft eq …)
———————————————————————————-/
void
dsp_DSP_callback(void *originalbuffer, void *newbuffer, int length, int param)
{
signed short *src = (signed short *)newbuffer; // source pointer from the data
signed short *dspbuff = (signed short *)param;
signed short *srcleft, *srcright;
int numsamples, count;

srcleft   = ((signed short *)newbuffer);
srcright  = ((signed short *)newbuffer)+1;

length <<= 1; // *2 for stereo (number of 16 bit samples) 



for (count=0; count<length; count+=2)
{
    signed int l, r;

    l = (signed int)srcleft[count];
    r = (signed int)srcright[count];

    if      (l < -32768) l = -32768;
    else if (l >  32767) l =  32767;
    if      (r < -32768) r = -32768;
    else if (r >  32767) r =  32767;

    dspbuff[count] = (signed short)(l << 1);
    dspbuff[count+1] = (signed short)(r << 1);

}

// dspid = the index of the plugin in the list
// dspmodule = the module index inside the current dsp  
numsamples = gs_vWinAmpPropsDSP[dspid].pModule->getModule(dspmodule)->ModifySamples(gs_vWinAmpPropsDSP[dspid].pModule->getModule(dspmodule), (short*)dspbuff, length / 2, 16, 2, 44100);

// the buffer is not altered, so keep it clean and return it
return (void*)param;

}

  • You must to post comments
0
0

hey, nice!
Thanks for all :) 😉

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.