Sound in Mad Tea Lab
Sound can be rendered by clicking the “Play” symbol in the header of the function box, then all enabled functions will be rendered into audio, added and peak normalized to 0.4, and then played.
Here is an example generating the melody and bass from “The Great Giana Sisters” theme
Sound can also be rendered from js code using the function
sound() which takes an array with values that are assumed to
be in the range -1 to 1. (values outside will be clipped to that range)
Sound is always mono and has a samplerate of 44100 hz, it is first converted to a WAV-file of 16bit, and then converted to base64 text, and via innerHTML played using the HTML 5 audio tag
Fallback mode
If this does not work for your browser, there is an alternative mode using an iframe
(this can be used by setting useAudioTag=0) then most browsers will use quicktime.
However there is another problem with quicktime+Mad Tea Lab, and that is that when using data-urls, it only accept some file lenghts (or perhaps sample lenghts). For instance, 0.6, 3, 9 and 13 seconds all work, but if you generate a sound with the length 1 or 2 seconds, it will just grey out and stop working. If you export a 1 second audio file to disk, and then drop it into the browser, it does play fine so I suspect it has to do with QT:s parsing of base64.