Skip to content

Commit ab88410

Browse files
committed
Fix WebAudio#2169: Remove redundant constraints in AudioParamDescriptor
The constraings in the members of the `AudioParamDescriptor` are removed. We replace that with a link to the steps in `registerProcessor` algorithm that describes how to handle the descriptor. Updated the algorithm to include a step to throw an error if `minValue` is greater than `maxValue`.
1 parent ca76b67 commit ab88410

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

index.bs

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9883,13 +9883,13 @@ Methods</h5>
98839883

98849884
1. Let <var>paramNames</var> be an empty Array.
98859885

9886-
1. For each <var>descriptor</var> of
9886+
1. <div id="steps-parameterDescriptorSequence"></div>
9887+
For each <var>descriptor</var> of
98879888
<var>parameterDescriptorSequence</var>:
9888-
98899889
1. Let <var>paramName</var> be the value of
98909890
the member {{AudioParamDescriptor/name}}
9891-
in <var>descriptor</var>. Throw
9892-
a {{NotSupportedError}} if
9891+
in <var>descriptor</var>. <span class="synchronous">Throw
9892+
a {{NotSupportedError}}</span> if
98939893
<var>paramNames</var> already
98949894
contains <var>paramName</var> value.
98959895

@@ -9911,10 +9911,15 @@ Methods</h5>
99119911
{{AudioParamDescriptor/maxValue}}
99129912
in <var>descriptor</var>.
99139913

9914+
1. If <var>minValue</var> is
9915+
greater than or equal <var>maxValue</var>,
9916+
<span class="synchronous">throw an
9917+
{{InvalidStateError}}</span>.
9918+
99149919
1. If <var>defaultValue</var> is less than
99159920
<var>minValue</var> or greater than
99169921
<var>maxValue</var>,
9917-
<span class="synchronous">throw a
9922+
<span class="synchronous">throw an
99189923
{{InvalidStateError}}</span>.
99199924

99209925
1. Append the key-value pair <var>name</var>
@@ -10568,40 +10573,29 @@ dictionary AudioParamDescriptor {
1056810573
<h6 id="dictionary-audioparamdescriptor-members">
1056910574
Dictionary {{AudioParamDescriptor}} Members</h6>
1057010575

10576+
There are constraints on the values for these members. See the <a
10577+
href="#steps-parameterDescriptorSequence">algorithm for handling an
10578+
AudioParamDescriptor</a> for the constraints.
10579+
1057110580
<dl dfn-type=dict-member dfn-for="AudioParamDescriptor">
1057210581
: <dfn>automationRate</dfn>
1057310582
::
1057410583
Represents the default automation rate.
10575-
1057610584
: <dfn>defaultValue</dfn>
1057710585
::
10578-
Represents the default value of the parameter. <span class="synchronous">If this value
10579-
is out of the range of float data type or the range defined
10580-
by {{AudioParamDescriptor/minValue}} and {{AudioParamDescriptor/maxValue}}, a
10581-
{{NotSupportedError}} exception MUST be thrown.</span>
10586+
Represents the default value of the parameter.
1058210587

1058310588
: <dfn>maxValue</dfn>
1058410589
::
10585-
Represents the maximum value. <span class="synchronous">A
10586-
{{NotSupportedError}} exception MUST be thrown if
10587-
this value is out of range of float data type or it is
10588-
smaller than <code>minValue</code>.</span> This value is the most
10589-
positive finite single precision floating-point number.
10590+
Represents the maximum value.
1059010591

1059110592
: <dfn>minValue</dfn>
1059210593
::
10593-
Represents the minimum value. <span class="synchronous">A
10594-
{{NotSupportedError}} exception MUST be thrown if
10595-
this value is out of range of float data type or it is
10596-
greater than <code>maxValue</code>.</span> This value is the most
10597-
negative finite single precision floating-point number.
10594+
Represents the minimum value.
1059810595

1059910596
: <dfn>name</dfn>
1060010597
::
10601-
Represents the name of the parameter. <span class="synchronous">A
10602-
{{NotSupportedError}} exception MUST be thrown when
10603-
a duplicated name is found when registering the class
10604-
definition.</span>
10598+
Represents the name of the parameter.
1060510599
</dl>
1060610600

1060710601
<h4 id="AudioWorklet-Sequence">

0 commit comments

Comments
 (0)