def convert_ms_to_frames(chunk_size_ms, framerate):
    """ 
        Convert chunk size in milleconds to chunk size in number of frames
    
        Framerate is in hz (cycles per second), chunk_size is in ms

        So we need to multiply framerate by chunk_size_ms/1000 to get the
        chunk size in frames. Round down to nearest int.
    """
    return int(framerate * (chunk_size_ms / 1000.0))