'Raises MonkeysAudioHeaderError'

@convert_error(IOError, MonkeysAudioHeaderError)
def __init__(self, fileobj):

    header = fileobj.read(76)
    if ((len(header) != 76) or (not header.startswith('MAC    '))):
        raise MonkeysAudioHeaderError("not    a    Monkey's    Audio    file")
    self.version = cdata.ushort_le(header[4:6])
    if (self.version >= 3980):
        (blocks_per_frame, final_frame_blocks, total_frames, self.bits_per_sample, self.channels, self.sample_rate) = struct.unpack('<IIIHHI', header[56:76])
    else:
        compression_level = cdata.ushort_le(header[6:8])
        (self.channels, self.sample_rate) = struct.unpack('<HI', header[10:16])
        (total_frames, final_frame_blocks) = struct.unpack('<II', header[24:32])
        if (self.version >= 3950):
            blocks_per_frame = (73728 * 4)
        elif ((self.version >= 3900) or ((self.version >= 3800) and (compression_level == 4))):
            blocks_per_frame = 73728
        else:
            blocks_per_frame = 9216
    self.version /= 1000.0
    self.length = 0.0
    if ((self.sample_rate != 0) and (total_frames > 0)):
        total_blocks = (((total_frames - 1) * blocks_per_frame) + final_frame_blocks)
        self.length = (float(total_blocks) / self.sample_rate)
