def calc_duration(audio, rate):
    """Calculates the length of the audio in seconds.
    params:
        audio: A numpy ndarray, which has 1 dimension and values within
               -1.0 to 1.0 (inclusive)
        rate: An integer, which is the rate at which samples are taken
    return: A float
    """
    return audio.size / rate