public override void ViewDidLoad () { base.ViewDidLoad (); AVAudioTapProcessorContext context = new AVAudioTapProcessorContext (); int size = Marshal.SizeOf (typeof(AVAudioTapProcessorContext)); IntPtr handle = Marshal.AllocHGlobal (size); Marshal.StructureToPtr<AVAudioTapProcessorContext> (context, handle, false); // Perform any additional setup after loading the view, typically from a nib. }
unsafe void TapInitialization(MTAudioProcessingTap tap, out void *tapStorage) { context = new AVAudioTapProcessorContext { SupportedTapProcessingFormat = false, IsNonInterleaved = false, SampleRate = double.NaN, SampleCount = 0, LeftChannelVolume = 0, RightChannelVolume = 0 }; // We don't use tapStorage we store all data within context field tapStorage = (void *)IntPtr.Zero; }