def frames(self, frameSize, windowFunction = None):
        frames = []
        start = 0
        end = frameSize
        while start < len(self):
            
            if windowFunction == None:
                frames.append(self[start:end])
            else:
                window = windowFunction(frameSize)
                window.shape = (frameSize, 1)
                window =  numpy.squeeze(window)
                frame = self[start:end]
                if len(frame) < len(window):
                    # Zero pad
                    frameType = frame.__class__.__name__

                    sampleRate = frame.sampleRate
                    channels = frame.channels
                    format = frame.format

                    diff = len(window) - len(frame)
                    frame = numpy.append(frame, [0] * diff)
                    
                    if frameType == "AudioFile":
                        frame = frame.view(pymir.AudioFile)
                    else:
                        frame = frame.view(Frame)

                    # Restore frame properties
                    frame.sampleRate = sampleRate
                    frame.channels = channels
                    frame.format = format
       
                windowedFrame = frame * window
                frames.append(windowedFrame)

            start = start + frameSize
            end = end + frameSize
            
        return frames
Decompose this frame into smaller frames of size frameSize
dataset/ETHPy150Open jsawruk/pymir/pymir/Frame.py/Frame.frames