Re: onEnded and connections

Raymond Toy writes:

> On Wed, Sep 4, 2013 at 3:03 PM, Robert O'Callahan <robert@ocallahan.org>wrote:
>
>> connectivity check is performed. In any case, the simplest API is to fire
>> the event no matter what, and that's what Gecko does.
>>
>
> So basically, as long as you call start(...), the event is fired when it is
> ends, no matter if the node is completely disconnected from destination or
> not.

While I'm not sure it is clear from the spec, I think the
intention of the |length| parameter to the OfflineAudioContext is
that only |length| samples are processed on the context, which
permits a situation where source playback does not reach its end
point.

Gecko doesn't send "ended" in this situation:

  var context = new window.OfflineAudioContext(1, 128, 12000);
  context.oncomplete = function(e) {
    dump("complete\n");
  };

  var source = context.createBufferSource();
  source.buffer = context.createBuffer(1, 12000, context.sampleRate);
  source.onended = function(e) {
    dump("ended\n");
  }
  source.connect(context.destination);
  source.start(0);

  context.startRendering();

Received on Friday, 6 September 2013 11:35:37 UTC