Beispiel #1
0
        private Mp3FrameData ParseData(Mp3FrameHeader header)
        {
            int padding   = header.Padding ? 1 : 0;
            int frameSize = ((144 * header.BitRate) / header.Frequency) + padding;

            // subtract the header length
            frameSize -= 4;
            byte[] data = new byte[frameSize];
            ReadBytes(data, frameSize);

            return(new Mp3FrameData(data));
        }
Beispiel #2
0
        private Mp3Frame ParseFrame()
        {
            Mp3FrameHeader header = ParseHeader();

            Mp3FrameData data = null;

            if (header.Valid)
            {
                data = ParseData(header);
            }
            else
            {
                return(null);
            }

            return(new Mp3Frame(header, data));
        }
Beispiel #3
0
 public Mp3Frame(Mp3FrameHeader header, Mp3FrameData data)
 {
     this.header = header;
     this.data   = data;
 }