'Parse MPEG stream information from a file-like object.
If an offset argument is given, it is used to start looking
for stream information and Xing headers; otherwise, ID3v2 tags
will be skipped automatically. A correct offset can make
loading files significantly faster.
Raises HeaderNotFoundError, error'

@convert_error(IOError, error)
def __init__(self, fileobj, offset=None):

    if (offset is None):
        fileobj.seek(0, 0)
    else:
        fileobj.seek(offset, 0)
    skip_id3(fileobj)
    max_read = (1024 * 1024)
    max_syncs = 1000
    enough_frames = 4
    min_frames = 2
    self.sketchy = True
    frames = []
    first_frame = None
    for _ in iter_sync(fileobj, max_read):
        max_syncs -= 1
        if (max_syncs <= 0):
            break
        for _ in xrange(enough_frames):
            try:
                frame = MPEGFrame(fileobj)
            except HeaderNotFoundError:
                break
            frames.append(frame)
            if (not frame.sketchy):
                break
        if ((len(frames) >= min_frames) and (first_frame is None)):
            first_frame = frames[0]
        if (frames and (not frames[(-1)].sketchy)):
            first_frame = frames[(-1)]
            self.sketchy = False
            break
        if (len(frames) >= enough_frames):
            first_frame = frames[0]
            self.sketchy = False
            break
        del frames[:]
    if (first_frame is None):
        raise HeaderNotFoundError("can't    sync    to    MPEG    frame")
    assert first_frame
    self.length = (-1)
    sketchy = self.sketchy
    self.__dict__.update(first_frame.__dict__)
    self.sketchy = sketchy
    if (self.length == (-1)):
        fileobj.seek(0, 2)
        content_size = (fileobj.tell() - first_frame.frame_offset)
        self.length = ((8 * content_size) / float(self.bitrate))
