def checkChunkSize(self, maxFrames):
        """Computes the number of chunks of size maxFrames, and
        changes maxFrames in case it does not provide long enough
        chunks (especially the last chunk). 
        """
        totFrames = np.int32(self.computeNFrames())
        nChunks = totFrames / maxFrames + 1
        # checking size of last chunk, if "small", then making it
        # more even sized chunks
        if (totFrames-(nChunks-1)*maxFrames <
            self.stftParams['windowSizeInSamples'] /
            self.stftParams['hopsize'] ):
            print "Modifying the maxframes, such that chunks not too small"
            maxFrames = np.int(np.ceil(np.double(totFrames)/nChunks))
            nChunks = totFrames/maxFrames 
            print "The chunks are then maximum", maxFrames