Ejemplo n.º 1
0
        // For reading
        public SF2(string path)
        {
            using (var reader = new BinaryReader(File.Open(path, FileMode.Open), Encoding.ASCII))
            {
                char[] chars = reader.ReadChars(4);
                if (new string(chars) != "RIFF")
                {
                    throw new InvalidDataException("RIFF header was not found at the start of the file.");
                }

                size  = reader.ReadUInt32();
                chars = reader.ReadChars(4);
                if (new string(chars) != "sfbk")
                {
                    throw new InvalidDataException("sfbk header was not found at the expected offset.");
                }

                InfoChunk  = new InfoListChunk(this, reader);
                SoundChunk = new SdtaListChunk(this, reader);
                HydraChunk = new PdtaListChunk(this, reader);
            }
        }
Ejemplo n.º 2
0
 // For creating
 public SF2()
 {
     InfoChunk  = new InfoListChunk(this);
     SoundChunk = new SdtaListChunk(this);
     HydraChunk = new PdtaListChunk(this);
 }