This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21240 - Specify what should happen when passing invalid offset/duration values to AudioBufferSourceNode.start
Summary: Specify what should happen when passing invalid offset/duration values to Aud...
Status: CLOSED WONTFIX
Alias: None
Product: AudioWG
Classification: Unclassified
Component: Web Audio API (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: TBD
Assignee: Chris Rogers
QA Contact: public-audio
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-10 17:10 UTC by Ehsan Akhgari [:ehsan]
Modified: 2014-10-28 17:16 UTC (History)
2 users (show)

See Also:


Attachments
Test case (871 bytes, text/html)
2013-03-10 17:10 UTC, Ehsan Akhgari [:ehsan]
Details

Description Ehsan Akhgari [:ehsan] 2013-03-10 17:10:27 UTC
Created attachment 1331 [details]
Test case

We need to specify what happens when these values are invalid, for example, negative, or greater than the length of the buffer.

Currently, WebKit ignores offset if it's negative but smaller than the length of the buffer, and in that case respects duration.  If a value larger than the length of the buffer is passed as offset, then WebKit ignores both offset and duration.  It would have probably made much more sense if these kinds of invalid values would throw DOM_SYNTAX_ERR as these are probably not what the author would intend to pass in.
Comment 1 Ehsan Akhgari [:ehsan] 2013-03-10 17:49:15 UTC
The same kind of problem seems to apply to loopStart as well.
Comment 2 Robert O'Callahan (Mozilla) 2013-03-10 21:26:13 UTC
I don't think throwing an exception is necessary here.

I don't like the behavior of just ignoring the offset if it's >= the length of the buffer. That creates a discontinuity as the offset increases from before the buffer end to after it.

If compatibility issues don't trump, then I suggest first clamping the offset to [0, length], then adding the duration to find the endpoint and clamping the endpoint.
Comment 3 Ehsan Akhgari [:ehsan] 2013-05-04 15:28:51 UTC
Chris, what do you think the right behavior here should be?
Comment 4 Joe Berkovitz / NF 2013-08-19 14:40:14 UTC
Also note bug 23007. If we accept that the duration value is shorthand for calling stop() at a specified temporal offset, then this bug goes away (or should be recast in terms of asking stop() to throw exceptions for invalid time offsets, etc.)
Comment 5 Olivier Thereaux 2014-10-28 17:13:30 UTC
Web Audio API issues have been migrated to Github. 
See https://github.com/WebAudio/web-audio-api/issues
Comment 6 Olivier Thereaux 2014-10-28 17:16:26 UTC
Closing. See https://github.com/WebAudio/web-audio-api/issues for up to date list of issues for the Web Audio API.