W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2011

Re: is sampling audio input possible?

From: Chris Lowis <chris.lowis@bbc.co.uk>
Date: Thu, 01 Dec 2011 14:03:24 +0000
Message-ID: <4ED7892C.6060206@bbc.co.uk>
To: public-audio@w3.org
On 30/11/2011 17:58, Stephen Bannasch wrote:
 > I'd like to be able to sample and display both amplitude and frequency
 > domain representations of audio input from an audio source.

If by "audio source" you mean the HTML <audio> element, then yes that is 
an example of the kind of thing that is possible with the proposed Audio 
APIs. I believe the Mozilla API will allow access to the amplitude data 
(the samples of the audio stream themselves) which you can then 
transform to a frequency domain representation using a javascript FFT 
implementation. I think the Webkit API as currently implemented does not 
give access to the audio samples, but does allow you to set up a block 
to calculate the spectrum (using an FFT).

If you wish to capture audio from the browser, you'd need the 
getUserMedia API 
the current support for which is very patchy (I think Opera have a 
partial implementation, and I heard Erricson were working on something 
too but haven't released it).

In the meantime, we've had some success with a Flash shim which allows 
audio input from the microphone: https://code.google.com/p/wami-recorder/

Hope that helps and that others can fill in the details or correct my 


Received on Thursday, 1 December 2011 14:03:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:49:57 UTC