public marks

PUBLIC MARKS from sbrothier with tags firefox & sounds

29 January 2014 11:00

TypedArray.org | JavaScript for interactive developers

A few years ago, I wrote a little ActionScript 3 library called MicRecorder, which allowed you to record the microphone input and export it to a .WAV file. Very simple, but pretty handy. The other day I thought it would be cool to port it to JavaScript. I realized quickly that it is not as easy. In Flash, the SampleDataEvent directly provides the byte stream  PCM samples) from the microphone. With getUserMedia, the Web Audio APIs are required to extract the samples. Note that getUserMedia and Web Audio are not broadly supported yet, but it is coming. Firefox has also landed Web Audio recently, which is great news.

All this is done in HTML5 by the way.

This project uses the new HTML5 Audio Data API. At the moment, only Firefox 4 beta supports this. Click the visualization area to toggle "fullscreen" mode.