Ejemplo n.º 1
0
        public static ExtAudioFile CreateWithUrl(MonoMac.CoreFoundation.CFUrl url,
                                                 AudioFileType fileType,
                                                 AudioStreamBasicDescription inStreamDesc,
                                                 //AudioChannelLayout channelLayout,
                                                 AudioFileFlags flag)
        {
            int    err;
            IntPtr ptr = new IntPtr();

            unsafe
            {
                err = ExtAudioFileCreateWithUrl(url.Handle, fileType, ref inStreamDesc, IntPtr.Zero, (uint)flag,
                                                (IntPtr)(&ptr));
            }
            if (err != 0)
            {
                throw new ArgumentException(String.Format("Error code:{0}", err));
            }
            if (ptr == IntPtr.Zero)
            {
                throw new InvalidOperationException("Can not get object instance");
            }

            return(new ExtAudioFile(ptr));
        }
Ejemplo n.º 2
0
        public static ExtAudioFile OpenUrl(MonoMac.CoreFoundation.CFUrl url)
        {
            int    err;
            IntPtr ptr = new IntPtr();

            unsafe {
                err = ExtAudioFileOpenUrl(url.Handle, (IntPtr)(&ptr));
            }
            if (err != 0)
            {
                throw new ArgumentException(String.Format("Error code:{0}", err));
            }
            if (ptr == IntPtr.Zero)
            {
                throw new InvalidOperationException("Can not get object instance");
            }

            return(new ExtAudioFile(ptr));
        }