Dynamic .WAV Generation in JavaScript

http://sk89q.therisenrealm.com/2008/11/dynamically-generating-a-wav-in-javascript/

This plays a sine wave by generating a .wav file on-the-fly and playing it through an EMBED tag linked by a data URI. No external files are used to play the sine wave.

Be aware of the following caveats:

Parameters
Hz
bits/sample
seconds
Hz (for optimal results: frequency ≤ sampleRate / 2)

Written by sk89q.