def METHOD_NAME(frames: int, fps: float) -> int:
    """
    Convert frame-based duration to milliseconds.
    Arguments:
        frames: Number of frames (should be int).
        fps: Framerate (must be a positive number, eg. 23.976).
    Returns:
        Number of milliseconds (rounded to int).
    Raises:
        ValueError: fps was negative or zero.
    """
    if fps <= 0:
        raise ValueError("Framerate must be positive number (%f)." % fps)
    return int(round(frames * (1000 / fps)))