public AudioUnitStatus SetRenderCallback(RenderDelegate renderDelegate, AudioUnitScopeType scope, uint audioUnitElement = 0) { var cb = new AURenderCallbackStruct(); cb.Proc = CreateRenderCallback; cb.ProcRefCon = GCHandle.ToIntPtr(gcHandle); this.render = renderDelegate; return(AudioUnitSetProperty(handle, AudioUnitPropertyIDType.SetRenderCallback, scope, audioUnitElement, ref cb, Marshal.SizeOf(cb))); }
static extern AUGraphError AUGraphSetNodeInputCallback(IntPtr inGraph, int inDestNode, uint inDestInputNumber, ref AURenderCallbackStruct inInputCallback);
static extern AudioUnitStatus AudioUnitSetProperty (IntPtr inUnit, AudioUnitPropertyIDType inID, AudioUnitScopeType inScope, uint inElement, ref AURenderCallbackStruct inData, int inDataSize);
public AudioUnitStatus SetRenderCallback (RenderDelegate renderDelegate, AudioUnitScopeType scope, uint audioUnitElement = 0) { var cb = new AURenderCallbackStruct (); cb.Proc = CreateRenderCallback; cb.ProcRefCon = GCHandle.ToIntPtr (gcHandle); this.render = renderDelegate; return AudioUnitSetProperty (handle, AudioUnitPropertyIDType.SetRenderCallback, scope, audioUnitElement, ref cb, Marshal.SizeOf (cb)); }
static extern AudioUnitStatus AudioUnitSetProperty(IntPtr inUnit, AudioUnitPropertyIDType inID, AudioUnitScopeType inScope, uint inElement, ref AURenderCallbackStruct inData, int inDataSize);