Bug 111952

Summary: WebKit uses the duration argument passed to AudioBufferSourceNode.start as the length of the buffer when looping
Product: WebKit Reporter: Ehsan Akhgari [:ehsan] <ehsan>
Component: Web AudioAssignee: Nobody <webkit-unassigned>
Status: UNCONFIRMED ---    
Severity: Normal CC: crogers
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Ehsan Akhgari [:ehsan] 2013-03-10 20:29:33 PDT
The spec says:

"Note that the default values for loopStart and loopEnd are both 0, which indicates that looping should occur from the very start to the very end of the buffer. "

According to this, WebKit's behavior in this test case <http://people.mozilla.org/~eakhgari/webaudio/loop-webkitbug.html> is wrong.  The looping sound when pressing both the first and second buttons should be the same.
Comment 1 Ehsan Akhgari [:ehsan] 2013-03-10 20:32:14 PDT
I can reproduce this in Chrome Canary, but it seems like WebKit Nightly cannot decode ogg files, so I cannot run the test there.
Comment 2 Ehsan Akhgari [:ehsan] 2013-03-10 20:34:39 PDT
Furthermore, the spec says:

"in loop mode will continue playing until it reaches the actualLoopEnd position in the buffer (or the end of the buffer), at which point it will wrap back around to the actualLoopStart position in the buffer, and continue playing according to this pattern", which seems to suggest that the duration argument should be completely ignored in looping mode.
Comment 3 Chris Rogers 2013-03-10 22:48:39 PDT
Let me have a look.  There may be some work in the spec we need to do.
Comment 4 Ehsan Akhgari [:ehsan] 2013-03-11 08:32:08 PDT
(In reply to comment #3)
> Let me have a look.  There may be some work in the spec we need to do.

Are you planning to change the spec for this?  I'm currently implementing what the current spec says, and this just seems like a bug in WebKit.
Comment 5 Chris Rogers 2013-03-11 10:34:53 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Let me have a look.  There may be some work in the spec we need to do.
> 
> Are you planning to change the spec for this?  I'm currently implementing what the current spec says, and this just seems like a bug in WebKit.

Let me take a closer look today