Skip to content

AudioWorkletNodeOptions.outputChannelCount #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 72 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9109,6 +9109,7 @@ <h2 id="AudioWorkletNodeOptions">
dictionary AudioWorkletNodeOptions : AudioNodeOptions {
unsigned long numberOfInputs = 1;
unsigned long numberOfOutputs = 1;
sequence&lt;unsigned long&gt; outputChannelCount;
record&lt;DOMString, double&gt; parameterData;
};
</pre>
Expand Down Expand Up @@ -9136,6 +9137,24 @@ <h3>
This is used to initialize the value of <a>AudioNode</a>
<a data-link-for="AudioNode">numberOfOutputs</a> attribute.
</dd>
<dt>
<code><dfn>outputChannelCount</dfn></code> of type
<span class="idlAttrType"><code>sequence&lt;unsigned
long&gt;</code></span>
</dt>
<dd>
This array is used to configure the number of channels in
each output. For example, <code>outputChannelCount: [n,
m]</code> specifies the number of channels in the first
output to <code>n</code> and the second output to
<code>m</code> respectively. <code>IndexSizeError</code> MUST
be thrown if the length of sequence does not match
<a data-link-for=
"AudioWorkletNodeOptions">numberOfOutputs</a>. A
<code>NotSupportedError</code> exception MUST be thrown if a
channel count is not in the valid range of AudioNode's
<a data-link-for="AudioNode">channelCount</a>.
</dd>
<dt>
<code><dfn>parameterData</dfn></code> of type <span class=
"idlAttrType"><code>record&lt;DOMString,
Expand All @@ -9150,6 +9169,52 @@ <h3>
</dd>
</dl>
</section>
<section>
<h3>
Configuring Channels with <a>AudioWorkletNodeOptions</a>
</h3>
<p>
With a combination of <a data-link-for=
"AudioWorkletNodeOptions">numberOfInputs</a>, <a data-link-for=
"AudioWorkletNodeOptions">numberOfOutputs</a> and
<a data-link-for=
"AudioWorkletNodeOptions">outputChannelCount</a>, various
channel configurations can be achieved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a table somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I actually prefer this way. I think a list is better than using <table> element. We only have 3 cases with a single description for each.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

</p>
<ol>
<li>
<a data-link-for="AudioWorkletNodeOptions">numberOfInputs</a>
= 0, <a data-link-for=
"AudioWorkletNodeOptions">numberOfOutputs</a> = 0
<ul>
<li>
<code>NotSupportedError</code> MUST be thrown by the
constructor.
</li>
</ul>
</li>
<li>
<a data-link-for="AudioWorkletNodeOptions">numberOfInputs</a>
= 1, <a data-link-for=
"AudioWorkletNodeOptions">numberOfOutputs</a> = 1
<ul>
<li>If <a data-link-for=
"AudioWorkletNodeOptions">outputChannelCount</a> is
unspecified, the output channel count will match
<a>computedNumberOfChannels</a> from the input.
</li>
</ul>
</li>
<li>All other cases
<ul>
<li>If <a data-link-for=
"AudioWorkletNodeOptions">outputChannelCount</a> is
unspecified, it will be mono for all outputs.
</li>
</ul>
</li>
</ol>
</section>
</section>
</section>
<section>
Expand Down Expand Up @@ -9266,8 +9331,9 @@ <h2 id="defining-a-valid-audioworkletprocessor">
by the user agent. <code>inputs[n][m]</code> is a
<code>Float32Array</code> of audio samples for the
<code>m</code>th channel of <code>n</code>th input. While the
number of inputs is fixed at the construction, the number of
channels can be changed dynamically.
number of inputs is fixed at construction, the number of
channels can be changed dynamically based on
<a>computedNumberOfChannels</a>.
</p>
<p>
If no connections exist to the <code>n</code>th input of the
Expand All @@ -9284,9 +9350,10 @@ <h2 id="defining-a-valid-audioworkletprocessor">
The output audio buffer that is to be consumed by the user
agent. <code>outputs[n][m]</code> is a
<code>Float32Array</code> object containing the audio samples
for <code>m</code>th channel of <code>n</code>th output. While
the number of outputs is fixed at the construction, the number
of channels can be changed dynamically.
for <code>m</code>th channel of <code>n</code>th output. The
number of channels in the output will match
<a>computedNumberOfChannels</a> only when the node has single
output.
</li>
<li>
<code>parameters</code> of type <code>Object</code><br>
Expand Down