'Read frame size in bytes. Returns None on error.'

def getFrameSize(self):

    frame_size = self.getBitRate()
    if (not frame_size):
        return None
    sample_rate = self.getSampleRate()
    if (not sample_rate):
        return None
    padding = int(self['use_padding'].value)
    if (self['layer'].value == self.LAYER_III):
        if (self['version'].value == self.MPEG_I):
            return (((frame_size * 144) // sample_rate) + padding)
        else:
            return (((frame_size * 72) // sample_rate) + padding)
    elif (self['layer'].value == self.LAYER_II):
        return (((frame_size * 144) / sample_rate) + padding)
    else:
        frame_size = ((frame_size * 12) / sample_rate)
        return ((frame_size + padding) * 4)
