Beispiel #1
0
        public void Load(byte *DataPointer, int DataLength)
        {
            //this.Data = Data;
            var Header = *(Header *)DataPointer;

            if (Header.Magic != 0)
            {
                throw(new NotImplementedException("!"));
            }

            /*
             * switch (Header.magic) {
             *      case "VAG":
             *              blocks = cast(Block[])Data[0x30..$];
             *      break;
             *      case "\0\0\0":
             *              blocks = cast(Block[])Data[0x10..$];
             *      break;
             *      default: throw(new Exception("Not a valid VAG File."));
             * }
             */

            //writefln("%s", this.header.toString);

            this.DecodedSamples = AudioMixer.Convert_Mono22050_Stereo44100(
                Decoder.DecodeBlocks(
                    (Block *)&DataPointer[0x10],
                    DataLength - 0x10
                    )
                );

            SaveToWav("output.wav");
        }