W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

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

From: Olivier Thereaux <notifications@github.com>
Date: Wed, 11 Sep 2013 07:29:32 -0700
To: WebAudio/web-audio-api <web-audio-api@noreply.github.com>
Message-ID: <WebAudio/web-audio-api/issues/71/24244172@github.com>
> [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:
Received on Wednesday, 11 September 2013 14:33:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:24 UTC