0
0

My code is like this and not working. Can someone give me a project in c# that solve this problem for pocket pc c# application

[DllImport(“fmodce.dll”)]
public static extern IntPtr FSOUND_DSP_Create(DelegateDSPCallback FSOUND_DSPCALLBACK, Enums.FSOUND_DSP_PRIORITIES priority, IntPtr userdata);
public delegate void DelegateDSPCallback(ref IntPtr originalbuffer, ref IntPtr newbuffer, int length, ref IntPtr userdata);
public void DSPCallback(ref IntPtr originalbuffer, ref IntPtr newbuffer, int length, ref IntPtr userdata)
{
byte[] bufferTmp = new byte[length * 2];
System.Runtime.InteropServices.Marshal.Copy(originalbuffer, bufferTmp, 0, length * 2);
// return newbuffer;
}

        public void InitDsp()
        {
            DelegateDSPCallback myCallBack = new DelegateDSPCallback(DSPCallback);
            IntPtr dsp = FSOUND_DSP_Create(myCallBack, FSOUND_DSP_PRIORITIES.FSOUND_DSP_DEFAULTPRIORITY_USER, IntPtr.Zero);
            FmodFunction.FSOUND_DSP_SetActive(dsp, true);
            FmodFunction.FSOUND_Stream_SetBufferSize(500);
        }
  • You must to post comments
0
0

The most obvious thing i can see is that your delegate declration is wrong. It should be returning a pointer (as it is declared in the c header)

  • You must to post comments
0
0

can u correct and rewrite my code again please thanks

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.