static extern int AudioUnitGetProperty(IntPtr inUnit,
                                        [MarshalAs(UnmanagedType.U4)] AudioUnitPropertyIDType inID,
                                        [MarshalAs(UnmanagedType.U4)] AudioUnitScopeType inScope,
                                        [MarshalAs(UnmanagedType.U4)] uint inElement,
                                        ref MonoTouch.AudioToolbox.AudioStreamBasicDescription outData,
                                        ref uint ioDataSize
                                        );
        public void SetAudioFormat(MonoTouch.AudioToolbox.AudioStreamBasicDescription audioFormat, AudioUnitScopeType scope, uint audioUnitElement)
        {
            int err = AudioUnitSetProperty(_audioUnit,
                                           AudioUnitPropertyIDType.kAudioUnitProperty_StreamFormat,
                                           scope,
                                           audioUnitElement,
                                           ref audioFormat,
                                           (uint)Marshal.SizeOf(audioFormat));

            if (err != 0)
            {
                throw new ArgumentException(String.Format("Error code:{0}", err));
            }
        }