Re: Valid start offsets and durations for AudioBufferSourceNodes?

Raymond Toy writes:

> The spec doesn't say, but are there any constraints on valid values for the
> offset or duration for the start method of an AudioBufferSourceNode?  What
> does it mean if the offset or duration is negative? What about a duration
> of 0?

I don't think it would be right to throw an exception for offset
or duration greater than the buffer length.  These are real
numbers so rounding errors may mean they end up a little greater
than the length.

Also, I assume |buffer| can be set after start() is called with
duration, but I guess this depends on and perhaps influences the
outcome from
http://lists.w3.org/Archives/Public/public-audio/2013JulSep/1866.html

Anyway, I don't think the method should throw on offset duration
too large.  Perhaps similar rounding in complex calculations could
make offset or duration less than zero, and consistency would
suggest also not throwing there.

Outside the sensible ranges for offset and duration, I think the
implementation should do the best it can.  Perhaps this means that
samples from the buffer will be played later if offset is
negative, but Gecko treats negative offsets as zero.

A duration of 0 should play nothing and I assume dispatch ended
when start time is reached, but I don't think Gecko dispatches
ended.

When to dispatch ended if duration is greater than buffer length
and buffer can be changed after start is difficult, related to
comments at [1].

[1] https://github.com/WebAudio/web-audio-api/issues/71#issuecomment-27033426

Received on Thursday, 31 October 2013 20:12:45 UTC