[Bug 18334] New: Asynchronous write

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18334

           Summary: Asynchronous write
           Product: AudioWG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Web Audio API
        AssignedTo: crogers@google.com
        ReportedBy: jussi.kalliokoski@gmail.com
         QAContact: public-audio@w3.org


I may be wrong, but it seems to me that currently the JavaScriptNode has no way
of filling the buffers asynchronously. I suggest we adopt the way that Robert's
proposal did the callbacks, having a write method on the event. Allowing
asynchronous writes makes sense in an environment like JS where most of the
external operations are asynchronous. Also, for example if we define a DSP
library that supports things such as convolution, it would be ideal for it to
provide asynchronous versions of the calls as well, to make it more natural to
the async flow of JS programs, not to mention that you could do concurrent
overlap-add things. So for example (very simplified):

var l = 2048

customNode.onaudioprocess = function (e) {
  var buffer = new Float32Array(l)

  oscillator.fillBufferAsync(buffer, function () {
    e.writeAudio(buffer)
  })
}

This would also allow one to write data ahead of time.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 19 July 2012 16:18:44 UTC