ISSUE-33: Add maxNumberOfChannels attribute to AudioDestinationNode
authorcrogers
Fri, 18 May 2012 16:27:19 -0700
changeset 48 90e55985e260
parent 47 b4680b4ee21d
child 49 812d1756323d
ISSUE-33: Add maxNumberOfChannels attribute to AudioDestinationNode
webaudio/specification.html
--- a/webaudio/specification.html	Fri May 18 15:50:08 2012 -0700
+++ b/webaudio/specification.html	Fri May 18 16:27:19 2012 -0700
@@ -1153,7 +1153,8 @@
 
     interface <dfn id="dfn-AudioDestinationNode">AudioDestinationNode</dfn> : AudioNode {
 
-        readonly attribute unsigned long numberOfChannels;
+        readonly attribute unsigned long maxNumberOfChannels;
+        attribute unsigned long numberOfChannels;
 
     }
     </code></pre>
@@ -1163,8 +1164,20 @@
 <div id="attributes-AudioDestinationNode-section" class="section">
 <h3 id="attributes-AudioDestinationNode">4.4.1. Attributes</h3>
 <dl>
+  <dt id="dfn-maxNumberOfChannels"><code>maxNumberOfChannels</code></dt>
+    <dd><p>The maximum number of channels that the <code>numberOfChannels</code> attribute can be set to.
+    An <code>AudioDestinationNode</code> representing the audio hardware end-point (the normal case) can potentially output more than
+    2 channels of audio if the audio hardware is multi-channel.  <code>maxNumberOfChannels</code> is the maximum number of channels that
+    this hardware is capable of supporting.  If this value is 0, then this indicates that <code>maxNumberOfChannels</code> may not be
+    changed.  This will be the case for an <code>AudioDestinationNode</code> in an <code>OfflineAudioContext</code>.</p>
+    </dd>
+</dl>
+
+<dl>
   <dt id="dfn-numberOfChannels_2"><code>numberOfChannels</code></dt>
-    <dd><p>The number of channels of the destination's input.</p>
+    <dd><p>The number of channels of the destination's input.  This value will default to 2, and may be set to any non-zero value less than or equal
+    to <code>maxNumberOfChannels</code>.  An exception will be thrown if this value is not within the valid range.  Giving a concrete example, if
+    the audio hardware supports 8-channel output, then we may set <code>numberOfChannels</code> to 8, and render 8-channels of output.  </p>
     </dd>
 </dl>
 </div>