Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p><strong>@param[out] op0</strong></p> <p>This variable receives the pointer to the resampled data. This pointer may point to the address within the "ip0" input buffer, or to *this object's internal buffer. In real-time applications it is suggested to pass this pointer to the next output audio block and consume any data left from the previous output audio block first before calling the process() function again. The buffer pointed to by the "op0" on return may be owned by the resampler, so it should not be freed by the caller.</p> </blockquote> <p>This immediately presents a constraint on <code>ip0</code>. You must arrange that the buffer that <code>ip0</code> points to is stable beyond the end of the call to the function. That implies that you must pin it before calling the function. Which in turn implies that it must be declared as <code>IntPtr</code>.</p> <p>For <code>op0</code>, this points to either memory owned by the resampler, or to a location within the <code>ip0</code> input buffer. So, again you are going to have to use an <code>IntPtr</code>, this time an <code>out</code> parameter.</p> <p>So, the declaration must be:</p> <pre><code>[DllImport("r8bsrc.dll", EntryPoint="process", CallingConvention = CallingConvention.Cdecl)] public static extern int Process(IntPtr ip0, int length, out IntPtr op0); </code></pre> <p>And as discussed above, the pointer you pass in <code>ip0</code> must be obtained using the <code>GCHandle</code> class so that you can pin the array.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload