W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2012

[Bug 18334] New: Asynchronous write

From: <bugzilla@jessica.w3.org>
Date: Thu, 19 Jul 2012 16:18:43 +0000
To: public-audio@w3.org
Message-ID: <bug-18334-5429@http.www.w3.org/Bugs/Public/>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 July 2012 16:18:44 GMT