The "standard" encoding for digital audio is pulse code modulation. The analog signal is sampled at regular intervals and stored as an amplitude quantity value.
Facts:
- CD audio uses 44,100 amplitude samples per second
- Each sample is a 16-bit integer between -32,768 and 32,767
One way to synthesize a pure frequency (in Hz) is to sample a sine wave.
Your task is to implement a function from a number of milliseconds and a frequency to a collection of samples.
buzz : milliseconds:float -> frequency:float -> seq<int16>
IEnumerable<int16> Buzz(double milliseconds, double frequency);
Buzz(1000, 440) // should produce 44100 samples of concert A
Buzz(2000, 0) // should produce 88200 zeros.