ISSUE-49: better define AudioBuffer audio data access
authorcrogers
Thu, 24 May 2012 17:35:45 -0700
changeset 61 5f1f174d7603
parent 60 5460cc594d14
child 62 7865f8b76f19
ISSUE-49: better define AudioBuffer audio data access
webaudio/specification.html
--- a/webaudio/specification.html	Thu May 24 17:15:29 2012 -0700
+++ b/webaudio/specification.html	Thu May 24 17:35:45 2012 -0700
@@ -1547,9 +1547,11 @@
 <h3 id="methodsandparams-AudioBuffer">4.9.2. Methods and Parameters</h3>
 <dl>
   <dt id="dfn-getChannelData">The <code>getChannelData</code> method</dt>
-    <dd><p>Gets direct access to the audio data stored in an AudioBuffer.</p>
+    <dd><p>Returns the <code>Float32Array</code> representing the PCM audio data for the specific channel.</p>
       <p>The <dfn id="dfn-channel">channel</dfn> parameter is an index
-      representing the particular channel to get data for. </p>
+      representing the particular channel to get data for.  An index value of 0 represents
+      the first channel.  This  index value MUST be less than <code>numberOfChannels</code>
+      or an exception will be thrown.</p>
     </dd>
 </dl>
 </div>
@@ -1824,13 +1826,17 @@
 <dl>
   <dt id="dfn-inputBuffer"><code>inputBuffer</code></dt>
     <dd><p>An AudioBuffer containing the input audio data.  It will have a number of channels equal to the <code>numberOfInputChannels</code> parameter
-    of the createJavaScriptNode() method. </p>
+    of the createJavaScriptNode() method.  This AudioBuffer is only valid while in the scope of the <code>onaudioprocess</code>
+    function.  Its values will be meaningless outside of this scope.</p>
     </dd>
 </dl>
 <dl>
   <dt id="dfn-outputBuffer"><code>outputBuffer</code></dt>
     <dd><p>An AudioBuffer where the output audio data should be written.  It will have a number of channels equal to the
-    <code>numberOfOutputChannels</code> parameter of the createJavaScriptNode() method. </p>
+    <code>numberOfOutputChannels</code> parameter of the createJavaScriptNode() method.
+      Script code within the scope of the <code>onaudioprocess</code> function is expected to modify the
+      <code>Float32Array</code> arrays representing channel data in this AudioBuffer.
+      Any script modifications to this AudioBuffer outside of this scope will not produce any audible effects.</p>
     </dd>
 </dl>
 </div>