Skip to content

Commit 0a3ea91

Browse files
authored
Fix WebAudio#2169: Remove redundant constraints in AudioParamDescriptor (WebAudio#2222)
* 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`. * Remove the new step and simplify the other step Makes it clear that min <= max.
1 parent 7f301c2 commit 0a3ea91

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

index.bs

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9890,13 +9890,13 @@ Methods</h5>
98909890

98919891
1. Let <var>paramNames</var> be an empty Array.
98929892

9893-
1. For each <var>descriptor</var> of
9893+
1. <div id="steps-parameterDescriptorSequence"></div>
9894+
For each <var>descriptor</var> of
98949895
<var>parameterDescriptorSequence</var>:
9895-
98969896
1. Let <var>paramName</var> be the value of
98979897
the member {{AudioParamDescriptor/name}}
9898-
in <var>descriptor</var>. Throw
9899-
a {{NotSupportedError}} if
9898+
in <var>descriptor</var>. <span class="synchronous">Throw
9899+
a {{NotSupportedError}}</span> if
99009900
<var>paramNames</var> already
99019901
contains <var>paramName</var> value.
99029902

@@ -9918,11 +9918,12 @@ Methods</h5>
99189918
{{AudioParamDescriptor/maxValue}}
99199919
in <var>descriptor</var>.
99209920

9921-
1. If <var>defaultValue</var> is less than
9922-
<var>minValue</var> or greater than
9923-
<var>maxValue</var>,
9924-
<span class="synchronous">throw a
9925-
{{InvalidStateError}}</span>.
9921+
1. If the expresstion
9922+
<var>minValue</var> &lt;=
9923+
<var>defaultValue</var> &lt;=
9924+
<var>maxValue</var> is false,
9925+
<span class="synchronous">throw
9926+
an {{InvalidStateError}}</span>.
99269927

99279928
1. Append the key-value pair <var>name</var>
99289929
<var>processorCtor</var> to
@@ -10575,40 +10576,29 @@ dictionary AudioParamDescriptor {
1057510576
<h6 id="dictionary-audioparamdescriptor-members">
1057610577
Dictionary {{AudioParamDescriptor}} Members</h6>
1057710578

10579+
There are constraints on the values for these members. See the <a
10580+
href="#steps-parameterDescriptorSequence">algorithm for handling an
10581+
AudioParamDescriptor</a> for the constraints.
10582+
1057810583
<dl dfn-type=dict-member dfn-for="AudioParamDescriptor">
1057910584
: <dfn>automationRate</dfn>
1058010585
::
1058110586
Represents the default automation rate.
10582-
1058310587
: <dfn>defaultValue</dfn>
1058410588
::
10585-
Represents the default value of the parameter. <span class="synchronous">If this value
10586-
is out of the range of float data type or the range defined
10587-
by {{AudioParamDescriptor/minValue}} and {{AudioParamDescriptor/maxValue}}, a
10588-
{{NotSupportedError}} exception MUST be thrown.</span>
10589+
Represents the default value of the parameter.
1058910590

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

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

1060610599
: <dfn>name</dfn>
1060710600
::
10608-
Represents the name of the parameter. <span class="synchronous">A
10609-
{{NotSupportedError}} exception MUST be thrown when
10610-
a duplicated name is found when registering the class
10611-
definition.</span>
10601+
Represents the name of the parameter.
1061210602
</dl>
1061310603

1061410604
<h4 id="AudioWorklet-Sequence">

0 commit comments

Comments
 (0)