// Sine wave var frequency = 440; var duration = 0.5; for (var i = 0; i < duration * sampleRate; ++i) { var t = i / sampleRate; samples.push(sin(2 * PI * frequency * t)); }
Play Stop
Examples: