[whatwg] Audio canvas?

Dr. Markus Walther walther at svox.com
Wed Jul 16 03:51:50 PDT 2008

I have noted an asymmetry between <canvas> and <audio>:

<canvas> supports loading of ready-made images _and_ pixel manipulation 

<audio> supports loading of ready-made audio but _not_ sample manipulation.

With browser JavaScript getting faster all the time (Squirrelfish...), 
audio manipulation in the browser is within reach, if supported by rich 
enough built-in objects.

Minimally, sample-accurate methods would be needed to
- get/set a sample value v at sample point t on channel c from audio
- play a region from sample point t1 to sample point t2

(Currently, everything is specified using absolute time, so rounding 
errors might prevent sample-accurate work).

More powerful methods might cut/add silence/amplify/fade portions of 
audio in a sample-accurate way.

It would be OK if this support were somewhat restricted, e.g. only for 
certain uncompressed audio formats such as PCM WAVE.

Question: What do people think about making <audio> more like <canvas> 
as sketched above?

-- Markus

More information about the whatwg mailing list