void _auGraph_RenderCallback(object sender, AudioGraphEventArgs e) { // is Post Render ? if ((e.ActionFlags & AudioUnit.AudioUnitRenderActionFlags.kAudioUnitRenderAction_PostRender) != 0) { /* * if (_isRecording) * { * // reading buffer * _extAudioFile.WriteAsync(e.NumberFrames, e.Data); * }*/ } }
static int renderCallback(IntPtr inRefCon, ref AudioUnitRenderActionFlags _ioActionFlags, ref AudioTimeStamp _inTimeStamp, int _inBusNumber, int _inNumberFrames, AudioBufferList _ioData) { // getting audiounit instance var handler = GCHandle.FromIntPtr(inRefCon); var inst = (AUGraph)handler.Target; // invoke event handler with an argument if (inst.RenderCallback != null){ var args = new AudioGraphEventArgs( _ioActionFlags, _inTimeStamp, _inBusNumber, _inNumberFrames, _ioData); inst.RenderCallback(inst, args); } return 0; // noerror }
#pragma warning disable 0612 void HandleRenderCallback(object sender, AudioGraphEventArgs e) { graphRenderCallbackCount++; }