Im using ASIO to record from inputs and Im trying to analyse the recorded data using C#. It first I was recording into a sound and was trying to use the pcmreadcallback. The sound would play fine but not matter what I tried, I could not read the data from that callback.

I am creating the sound with:

[code:29xi04c9]fresult = fsystem.createSound(null, (FMOD.MODE._2D | FMOD.MODE.SOFTWARE | FMOD.MODE.LOOP_NORMAL | FMOD.MODE.OPENUSER), ref fExInfo, ref fsound);[/code:29xi04c9]

And the callback itself looks like (for testing purposes):

[code:29xi04c9]private static FMOD.RESULT PCMREADCALLBACK(IntPtr soundraw, IntPtr data, uint datalen)
uint count;

    short *stereo16bitbuffer = (short *)data.ToPointer();

    for (count=0; count < datalen>>2; count++)
        nVal = *stereo16bitbuffer++;


The callback is entered, but no matter what I try I cant seem populate nVal with audio data.

Should I create a custom DSP callback using FMOD_DSP_READCALLBACK. If so, are there any examples using c#???

Any help would be greatly appreciated. Thanks

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.