Example #1
0
        public static BSTWaveInfo readStream(BeBinaryReader br, int fmt)
        {
            var newWI = new BSTWaveInfo();

            newWI.format = fmt;
            switch (fmt & 0xF0)
            {
            case 0x40:
                break;

            case 0x50:
                // Console.WriteLine($"{br.BaseStream.Position:X}");
                newWI.wSoundID = br.ReadInt16();
                // Console.WriteLine(newWI.wSoundID);
                break;

            case 0x60:
                break;

            case 0x70:
                newWI.streamFormat = br.ReadByte();
                newWI.unk1         = br.ReadByte();
                newWI.flags        = br.ReadUInt16();
                var namePointer = br.ReadInt32();
                br.BaseStream.Position = namePointer;
                newWI.streamFilePath   = JBST.readTerminated(br, 0x00);
                break;
            }
            return(newWI);
        }
Example #2
0
        public static BSTGroup readStream(BeBinaryReader br)
        {
            var newSect = new BSTGroup();
            var count   = br.ReadInt32();

            br.ReadInt32(); // Alignment (skip 4 bytes, always 0);
            newSect.waves = new BSTWaveInfo[count];
            for (int i = 0; i < count; i++)
            {
                var anch = br.BaseStream.Position + 4; // Return to the section in front of the current one
                var type = br.ReadByte();              // Describes type
                var addr = Helpers.ReadUInt24BE(br);
                br.BaseStream.Position = addr;
                newSect.waves[i]       = BSTWaveInfo.readStream(br, type);

                br.BaseStream.Position = anch;
            }
            return(newSect);
        }