<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18334</bug_id>
          
          <creation_ts>2012-07-19 16:18:42 +0000</creation_ts>
          <short_desc>Asynchronous write</short_desc>
          <delta_ts>2012-10-24 09:16:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jussi Kalliokoski">jussi.kalliokoski</reporter>
          <assigned_to name="Chris Rogers">crogers</assigned_to>
          <cc>olivier.thereaux</cc>
          
          <qa_contact>public-audio</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71159</commentid>
    <comment_count>0</comment_count>
    <who name="Jussi Kalliokoski">jussi.kalliokoski</who>
    <bug_when>2012-07-19 16:18:42 +0000</bug_when>
    <thetext>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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75399</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-10-05 20:23:32 +0000</bug_when>
    <thetext>I think we effectively already have an async write() in AudioBufferSourceNode.start()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75423</commentid>
    <comment_count>2</comment_count>
    <who name="Jussi Kalliokoski">jussi.kalliokoski</who>
    <bug_when>2012-10-05 22:32:13 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I think we effectively already have an async write() in
&gt; AudioBufferSourceNode.start()

That&apos;s not suitable for continuous asynchronously generated audio, but this feature is actually probably better off as custom JS buffer handling. Closing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77028</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-10-24 09:16:46 +0000</bug_when>
    <thetext>Seeing no objection to the resolution as invalid in over 2 weeks, closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>