public override void Parse(Stream input)
{
BinaryReader br = new BinaryReader(input);
BitStream bits = new BitStream(input);
this._initialSampleLeft = br.ReadInt16();
this._initialIndexLeft = (Byte)bits.GetBits(6);
this._initialSampleRight = br.ReadInt16();
this._initialIndexRight = (Byte)bits.GetBits(6);
this._adpcmCodeData = new Byte[(Int32)(input.Length - input.Position) + 2];
input.Read(this._adpcmCodeData, 0, this._adpcmCodeData.Length);
}
/// <summary> /// /// </summary> /// <param name="input"></param> /// <param name="type"></param> public void Parse(Stream input, SoundType type) { BitStream bits = new BitStream(input); this._ADPCMCodeSize = (Byte)bits.GetBits(2); if (type.Equals(SoundType.mono)) { AdpcmMonoPacket packet = new AdpcmMonoPacket(); packet.Parse(input); this._ADPCMPacket = packet; } else if (type.Equals(SoundType.stereo)) { AdpcmStereoPacket packet = new AdpcmStereoPacket(); packet.Parse(input); this._ADPCMPacket = packet; } }