Example #1
0
        public static Scd Read(Stream stream)
        {
            Scd scd = new Scd();

            header            = BinaryMapping.ReadObject <Header>(stream);
            tableOffsetHeader = BinaryMapping.ReadObject <TableOffsetHeader>(stream);

            stream.Seek(tableOffsetHeader.Table1Offset, SeekOrigin.Begin);

            List <uint> SoundOffsets = new List <uint>();

            for (int i = 0; i < tableOffsetHeader.Table1ElementCount; i++)
            {
                SoundOffsets.Add(stream.ReadUInt32());
            }

            foreach (uint off in SoundOffsets)
            {
                stream.Seek(off, SeekOrigin.Begin);
                var streamInfo = BinaryMapping.ReadObject <StreamHeader>(stream);

                byte[] st = stream.ReadBytes((int)streamInfo.StreamSize);
                StreamFiles.Add(st);

                // Convert to VAG Streams.

                /*VAGHeader vagHeader = new VAGHeader();
                 * vagHeader.ChannelCount = (byte)streamInfo.ChannelCount;
                 * vagHeader.SamplingFrequency = (byte)streamInfo.SampleRate;
                 * vagHeader.Version = 3;
                 * vagHeader.Magic = 0x70474156;
                 * vagHeader.Name = p.ToString();*/
            }



            return(scd);
        }
Example #2
0
 public static void Write(Scd scd, Stream stream)
 {
 }