[whatwg] Audio synthesis

Ian Hickson ian at hixie.ch
Sat Aug 1 01:40:12 PDT 2009

On Tue, 21 Jul 2009, Patrick Mueller wrote:
> 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.  :-)

I agree that looping should be seamless, but really we can't even 
guarantee that the start of the clip will still be in RAM when you reach 
the end, so this is more a quality-of-implementation issue than a spec 

On Wed, 22 Jul 2009, Philip Jägenstedt wrote:
> The spec simply says "If the media element has a loop attribute 
> specified, then seek to the earliest possible position of the media 
> resource and abort these steps." This would give seamless looping if an 
> implementation makes an effort to make it so. I certainly don't think 
> there should be an option to have seamless looping or not, each 
> implementation will simply have to do its best.


On Wed, 22 Jul 2009, Anne van Kesteren wrote:
> Unless memory fails me badly, the sole reason we have a looping API at 
> all is for seamless looping. (Otherwise you'd simply listen for the 
> ended event and invoke play() when it is dispatched.)

Also true.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list