Re: [web-audio-api] Unclear semantics of duration param to AudioBufferSourceNode.start() (#71)

> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=23007#1) by Chris Wilson on W3C Bugzilla. Mon, 19 Aug 2013 17:17:19 GMT

Actually, I don't think the spec *is* very clear here, reconciling loopStart/loopEnd with the duration parameter.

As I see it, loopStart/loopEnd are very oddly specified; the default values (0 and 0) would appear to loop a zero-length portion at the beginning of the buffer.  Oddly, you can set loopEnd without loopStart, but you can't set loopStart without setting loopEnd (despite "zero" seeming like a magic "length of buffer" value).  I think this is a bug, also.

In general, the duration parameter is a useful shorthand, and I don't like parameters that magically take no effect in "some" cases.  I think it is quite possible to reconcile loopStart/loopEnd with the duration parameter, but you're right that it is not reconciled today - in the addition of loopStart/loopEnd, duration seems to have been forgotten for looping cases. 

Perhaps "if duration is specified, this will set actualLoopEnd=max(buffer.length,loopStart+duration)"? (In spirit, at least - haven't worked out the whole section rewording.)

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/71#issuecomment-24244172

Received on Wednesday, 11 September 2013 14:33:04 UTC