AudioBufferSourceNode start(0) without a buffer?

Consider this:

c = new webkitAudioContex();
s = c.createBufferSource();
s.connect(c,destination);
c.decodeAudioData(data, function () { s.buffer = data });
s.start(0);

Let's say decodeAudioData takes 10 sec to decode.  What is supposed to
happen here?

Historically in webkit and blink, silence would be played and when the
buffer is set, it starts playing immediately for the duration of the new
buffer.  This is a simplified case of a bug reported in
https://code.google.com/p/chromium/issues/detail?id=334237, wherein I
accidentally changed the behavior in blink to play for 0 sec and stop.  The
setting of the buffer then has no effect since the source has already
stopped.

For backward compatibility, it would be good to keep the old behavior.
However, this seems rather racy, and isn't very well-specified. I think we
need to decide what should happen here.

Ray

Received on Wednesday, 22 January 2014 00:27:11 UTC