[whatwg] Audio synthesis

Patrick Mueller pmuellr at muellerware.org
Tue Jul 21 06:36:42 PDT 2009


Ian Hickson wrote:
> On Tue, 7 Jul 2009, Philip Jagenstedt wrote:
>> For all of the simpler use cases you can already generate sounds 
>> yourself with a data uri. For example, with is 2 samples of silence: 
>> "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQAAAAAAAAA".

I hope we haven't infringed a John Cage copyright here.

>> It might be worthwhile implementing the API you want as a JavaScript 
>> library and see if you can actually do useful things with it. If the use 
>> cases are compelling and require native browser support to be performant 
>> enough, perhaps it could go into a future version of HTML.
> 
> A JS library attempting to do this would definitely be helpful in 
> determining how much need there is for this.

I've just started playing a bit with audio.  One thing I noticed with 
both FF 3.5 and WebKit nightlies is that usage of the "loop" attribute 
set to true does not provide seamless looping.  ie, there is a 
significant pause between when the audio clip end is reached and when 
the clip starts again.

The spec makes no statement on the seamless-ness of the looping.

 From a practical standpoint though, having seamless looping is 
important if you actually have audio that is designed to loop, and you'd 
like to just allocate the resource for one loop.  Think of the 
background sound for a game, for instance.  It also makes the trick of 
using a very short sound clip specified in a data: url pretty much 
worthless, as you'd presumably want to loop such a clip seamlessly.

It makes me wonder what the use of having the seamful looping actually 
is, besides of course annoying people.  :-)

-- 
Patrick Mueller




More information about the whatwg mailing list