示例#1
0
        public void Load(IReadable input)
        {
            var id = input.Read8BitChars(4);
            var size = input.ReadInt32LE();
            if (id.ToLower() != "riff")
                throw new Exception("Invalid soundfont. Could not find RIFF header.");
            id = input.Read8BitChars(4);
            if (id.ToLower() != "sfbk")
                throw new Exception("Invalid soundfont. Riff type is invalid.");

            Logger.Debug("Reading info chunk");
            Info = new SoundFontInfo(input);
            Logger.Debug("Reading sampledata chunk");
            SampleData = new SoundFontSampleData(input);
            Logger.Debug("Reading preset chunk");
            Presets = new SoundFontPresets(input);
        }
示例#2
0
        public void Load(IReadable input)
        {
            var id   = input.Read8BitChars(4);
            var size = input.ReadInt32LE();

            if (id.ToLower() != "riff")
            {
                throw new Exception("Invalid soundfont. Could not find RIFF header.");
            }
            id = input.Read8BitChars(4);
            if (id.ToLower() != "sfbk")
            {
                throw new Exception("Invalid soundfont. Riff type is invalid.");
            }

            Logger.Debug("Reading info chunk");
            Info = new SoundFontInfo(input);
            Logger.Debug("Reading sampledata chunk");
            SampleData = new SoundFontSampleData(input);
            Logger.Debug("Reading preset chunk");
            Presets = new SoundFontPresets(input);
        }