import math


def _sine_sample(amp, freq, rate, i) -> float:
    """
    Generates a single audio sample taken at the given sampling rate on 
    a sine wave oscillating at the given frequency at the given amplitude.

    :param float amp The amplitude of the sine wave to sample
    :param float freq The frequency of the sine wave to sample
    :param int rate The sampling rate
    :param int i The index of the sample to pull

    :return float The audio sample as described above
    """
    return float(amp) * math.sin(2.0 * math.pi * float(freq)
        * (float(i) / float(rate)))