Bug 21541: Move information on multi channel to audio node definition
authorcrogers
Mon, 08 Apr 2013 17:41:35 -0700
changeset 294 4bab1c09d1d8
parent 293 f4b0a9d88309
child 295 666831bdd706
Bug 21541: Move information on multi channel to audio node definition
webaudio/specification.html
--- a/webaudio/specification.html	Mon Apr 08 15:58:37 2013 -0700
+++ b/webaudio/specification.html	Mon Apr 08 17:41:35 2013 -0700
@@ -308,11 +308,18 @@
       <li><a href="#Example-DynamicLifetime">Example</a></li>
     </ul>
   </li>
-  <li><a href="#ChannelLayouts">8. Channel Layouts</a></li>
   <li><a href="#UpMix">9. Channel up-mixing and down-mixing</a> 
     <ul>
-      <li><a href="#UpMix-sub">Up Mixing</a></li>
-      <li><a href="#down-mix">Down Mixing</a></li>
+      <li><a href="#ChannelLayouts">9.1. Speaker Channel Layouts</a>
+      <ul>
+        <li><a href="#ChannelOrdering">9.1.1. Channel Ordering</a></li>
+        <li><a href="#UpMix-sub">9.1.2. Up Mixing</a></li>
+        <li><a href="#down-mix">9.1.3. Down Mixing</a></li>
+      </ul>
+      </li>
+
+      <li><a href="#ChannelRules-section">9.2. Channel Rules Examples</a>
+
     </ul>
   </li>
   <li><a href="#Spatialization">11. Spatialization / Panning </a> 
@@ -4150,45 +4157,6 @@
 </div>
 
 
-<div id="ChannelLayouts-section" class="section">
-<h2 id="ChannelLayouts">8. Channel Layouts</h2>
-
-<p>It's important to define the channel ordering (and define some
-abbreviations) for different speaker layouts.</p>
-
-<p>
-For now, only considers cases for mono, stereo, quad, 5.1. Later other channel
-layouts can be defined. 
-</p>
-
-<p>The simple mono and stereo channel layouts are clear: </p>
-<pre>  Mono
-    0: M: mono
-    
-  Stereo
-    0: L: left
-    1: R: right
-  </pre>
-
-<p>A more advanced implementation can handle channel layouts for quad and 5.1:
-</p>
-<pre>  Quad
-    0: L:  left
-    1: R:  right
-    2: SL: surround left
-    3: SR: surround right
-
-  5.1
-    0: L:   left
-    1: R:   right
-    2: C:   center
-    3: LFE: subwoofer
-    4: SL:  surround left
-    5: SR:  surround right
-  </pre>
-
-<p>Other layouts can also be considered. </p>
-</div>
 
 <div id="UpMix-section" class="section">
 <h2 id="UpMix">9. Channel up-mixing and down-mixing</h2>
@@ -4251,7 +4219,7 @@
 performed.  The default value is "speakers".
 
 <ul>
-<li>“speakers”: use <a href="#UpMix-sub">up-down-mix equations for mono/stereo/quad/5.1</a>.
+<li>“speakers”: use <a href="#ChannelLayouts">up-down-mix equations for mono/stereo/quad/5.1</a>.
 In cases where the number of channels do not match any of these basic speaker layouts, revert
 to "discrete".
 </li>
@@ -4280,45 +4248,52 @@
 
 
 
-<h3>Examples</h3>
-
-<p class="norm">This section is informative.</p>
-
-<div class="block">
-<div class="blockTitleDiv">
-<div class="blockContent">
-<pre class="code"><code class="idl-code"> 
-// Set gain node to explicit 2-channels (stereo).
-gain.channelCount = 2;
-gain.channelCountMode = "explicit";
-gain.channelInterpretation = "speakers";
-
-// Set “hardware output” to 4-channels for DJ-app with two stereo output busses.
-context.destination.channelCount = 4;
-context.destination.channelCountMode = "explicit";
-context.destination.channelInterpretation = "discrete";
-
-// Set “hardware output” to 8-channels for custom multi-channel speaker array
-// with custom matrix mixing.
-context.destination.channelCount = 8;
-context.destination.channelCountMode = "explicit";
-context.destination.channelInterpretation = "discrete";
-
-// Set “hardware output” to 5.1 to play an HTMLAudioElement.
-context.destination.channelCount = 6;
-context.destination.channelCountMode = "explicit";
-context.destination.channelInterpretation = "speakers";
-
-// Explicitly down-mix to mono.
-gain.channelCount = 1;
-gain.channelCountMode = "explicit";
-gain.channelInterpretation = "speakers";
-</code></pre>
-</div>
-</div>
-</div>
-
-<h3 id="UpMix-sub">9.1. Up Mixing speaker layouts</h3>
+
+<div id="ChannelLayouts-section" class="section">
+<h3 id="ChannelLayouts">9.1. Speaker Channel Layouts</h3>
+
+<p class="norm">This section is normative.</p>
+
+<p>
+When <dfn>channelInterpretation</dfn> is "speakers" then the up-mixing and down-mixing
+is defined for specific channel layouts.
+</p>
+
+<p>It's important to define the channel ordering (and define some
+abbreviations) for these speaker layouts.</p>
+
+<p>
+For now, only considers cases for mono, stereo, quad, 5.1. Later other channel
+layouts can be defined. 
+</p>
+
+<h4 id ="ChannelOrdering">9.1.1. Channel ordering</h4>
+
+<pre>  Mono
+    0: M: mono
+    
+  Stereo
+    0: L: left
+    1: R: right
+  </pre>
+
+<pre>  Quad
+    0: L:  left
+    1: R:  right
+    2: SL: surround left
+    3: SR: surround right
+
+  5.1
+    0: L:   left
+    1: R:   right
+    2: C:   center
+    3: LFE: subwoofer
+    4: SL:  surround left
+    5: SR:  surround right
+  </pre>
+</div>
+
+<h4 id="UpMix-sub">9.1.2. Up Mixing speaker layouts</h4>
 
 <pre>Mono up-mix:
     
@@ -4366,7 +4341,7 @@
         output.SL = input.SL;
         output.SR = input.SR;</pre>
 
-<h3 id="down-mix">9.2. Down Mixing speaker layouts</h3>
+<h4 id="down-mix">9.1.3. Down Mixing speaker layouts</h4>
 
 <p>A down-mix will be necessary, for example, if processing 5.1 source
 material, but playing back stereo. </p>
@@ -4404,6 +4379,45 @@
 </pre>
 </div>
 
+<h3 id="ChannelRules-section">9.2. Channel Rules Examples</h3>
+
+<p class="norm">This section is informative.</p>
+
+<div class="block">
+<div class="blockTitleDiv">
+<div class="blockContent">
+<pre class="code"><code class="idl-code"> 
+// Set gain node to explicit 2-channels (stereo).
+gain.channelCount = 2;
+gain.channelCountMode = "explicit";
+gain.channelInterpretation = "speakers";
+
+// Set “hardware output” to 4-channels for DJ-app with two stereo output busses.
+context.destination.channelCount = 4;
+context.destination.channelCountMode = "explicit";
+context.destination.channelInterpretation = "discrete";
+
+// Set “hardware output” to 8-channels for custom multi-channel speaker array
+// with custom matrix mixing.
+context.destination.channelCount = 8;
+context.destination.channelCountMode = "explicit";
+context.destination.channelInterpretation = "discrete";
+
+// Set “hardware output” to 5.1 to play an HTMLAudioElement.
+context.destination.channelCount = 6;
+context.destination.channelCountMode = "explicit";
+context.destination.channelInterpretation = "speakers";
+
+// Explicitly down-mix to mono.
+gain.channelCount = 1;
+gain.channelCountMode = "explicit";
+gain.channelInterpretation = "speakers";
+</code></pre>
+</div>
+</div>
+</div>
+
+
 <div id="Spatialization-section" class="section">
 <h2 id="Spatialization">11. Spatialization / Panning </h2>