コード例 #1
0
        private static unsafe SndFile Open__(
            SfVirtual @virtual, SfMode mode, IntPtr userData, SfFormat format)
        {
            if (@virtual == SfVirtual.Empty)
            {
                throw new ArgumentNullException(nameof(@virtual));
            }

            CheckOpenParameters(format, mode);

            var info    = format.ToInfo();
            var sndFile = sf_open_virtual(ref @virtual, mode, ref info, userData);

            return(sndFile == null ? null : new SndFile(sndFile, info));
        }
コード例 #2
0
        private static unsafe SndFile Open__(
            [NotNull] string path, SfFormat format, SfMode mode)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            CheckOpenParameters(format, mode);

            var info    = format.ToInfo();
            var sndFile = sf_wchar_open(path, mode, ref info);

            return(sndFile == null ? null : new SndFile(sndFile, info));
        }