public static SoundInfo Parse(System.IO.Stream input)
{
BinaryReader br = new BinaryReader(input);
BitStream bits = new BitStream(input);
SoundInfo info = new SoundInfo();
bool _reserved1 = bits.GetBits(1) == 1;
bool _reserved2 = bits.GetBits(1) == 1;
info._syncstop = bits.GetBits(1) == 1;
info._syncnomultiple = bits.GetBits(1) == 1;
info._hasEnvelope = bits.GetBits(1) == 1;
info._hasLoops = bits.GetBits(1) == 1;
info._hasOutPoint = bits.GetBits(1) == 1;
info._hasInPoint = bits.GetBits(1) == 1;
if (_reserved1 || _reserved2)
throw new SwfFormatException("Reserved bits are not set to false");
if (info._hasInPoint)
info._inPoint = br.ReadUInt32();
if (info._hasOutPoint)
info._outPoint = br.ReadUInt32();
if (info._hasLoops)
info._loopCount = br.ReadUInt16();
if (info._hasEnvelope)
{
info._envelopePoints = br.ReadByte();
info._envelopeRecords = new SoundEnvelope[info._envelopePoints];
for (uint i = 0; i < info._envelopePoints; i++)
info._envelopeRecords[i] = SoundEnvelope.Parse(br);
}
return info;
}