Recurity.Swf.TagHandler.SoundStreamHead.Parse C# (CSharp) Method

Parse() protected method

protected Parse ( ) : void
return void
        protected override void Parse()
        {
            BinaryReader br = new BinaryReader(this._dataStream);
            BitStream bits = new BitStream(this._dataStream);

            ushort _reserved = (ushort)bits.GetBits(4);
            this._playbacksoundrate = DefineSound.getSoundRate(bits.GetBits(2));
            this._playbacksoundsize = (bits.GetBits(1) == 0) ? SoundSize.snd_8bit : SoundSize.snd_16bit;
            this._playbacksoundtype = (bits.GetBits(1) == 0) ? SoundType.mono : SoundType.stereo;

            this._streamsoundcompression = DefineSound.getFormat(bits.GetBits(4));
            this._streamsoundrate = DefineSound.getSoundRate(bits.GetBits(2));
            this._streamsoundsize = (bits.GetBits(1) == 0) ? SoundSize.snd_8bit : SoundSize.snd_16bit;
            this._streamsoundtype = (bits.GetBits(1) == 0) ? SoundType.mono : SoundType.stereo;

            this._streamsoundsamplecount = br.ReadUInt16();

            if (_streamsoundcompression == SoundEncoding.MP3)
                this._latencyseek = br.ReadInt16();

            if (_reserved != 0)
            {
                Exception e = new SwfFormatException("Reserved bits are set");
                Log.Warn(this, e);
            }
            String s1 = String.Format("0x{0:X08}: reading soundstreamhead. Avarage samples {1}", this.Tag.OffsetData, this.AvarageCount);
            Log.Debug(this, s1);

               String s2 = String.Format("0x{0:X08}:\tPlayback: {1} {2} {3}",
                this.Tag.OffsetData,
                this.PlaybackRate,
                this.PlaybackSize,
                this.PlaybackType);
               Log.Debug(this, s2);

               String s3 = String.Format("0x{0:X08}:\tStream:   {1} {2} {3} {4}",
                this.Tag.OffsetData,
                this.StreamCompression,
                this.StreamRate,
                this.StreamSize,
                this.StreamType);
               Log.Debug(this, s3);
        }