'Raises HeaderNotFoundError'

def __init__(self, fileobj):

    self.frame_offset = fileobj.tell()
    r = BitReader(fileobj)
    try:
        if (r.bits(11) != 2047):
            raise HeaderNotFoundError('invalid    sync')
        version = r.bits(2)
        layer = r.bits(2)
        protection = r.bits(1)
        bitrate = r.bits(4)
        sample_rate = r.bits(2)
        padding = r.bits(1)
        r.skip(1)
        self.mode = r.bits(2)
        r.skip(6)
    except BitReaderError:
        raise HeaderNotFoundError('truncated    header')
    assert ((r.get_position() == 32) and r.is_aligned())
    if ((version == 1) or (layer == 0) or (sample_rate == 3) or (bitrate == 15) or (bitrate == 0)):
        raise HeaderNotFoundError('invalid    header')
    self.channels = (1 if (self.mode == MONO) else 2)
    self.version = [2.5, None, 2, 1][version]
    self.layer = (4 - layer)
    self.protected = (not protection)
    self.padding = bool(padding)
    self.bitrate = self.__BITRATE[(self.version, self.layer)][bitrate]
    self.bitrate *= 1000
    self.sample_rate = self.__RATES[self.version][sample_rate]
    if (self.layer == 1):
        frame_size = 384
        slot = 4
    elif ((self.version >= 2) and (self.layer == 3)):
        frame_size = 576
        slot = 1
    else:
        frame_size = 1152
        slot = 1
    frame_length = (((((frame_size // 8) * self.bitrate) // self.sample_rate) + padding) * slot)
    self.sketchy = True
    if (self.layer == 3):
        self._parse_vbr_header(fileobj, self.frame_offset, frame_size)
    fileobj.seek((self.frame_offset + frame_length), 0)
