Skip to content
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

It would be clearer if the various validation of AudioWorkletNodeOptions were an explicit step or set of steps #1969

Closed
bzbarsky opened this issue Jul 5, 2019 · 2 comments · Fixed by #2023
Assignees

Comments

@bzbarsky
Copy link

bzbarsky commented Jul 5, 2019

https://webaudio.github.io/web-audio-api/#dictionary-audioworkletnodeoptions-members defines various validity constraints on AudioWorkletNodeOptions members that are supposed to lead to exceptions.

https://webaudio.github.io/web-audio-api/#configuring-channels-with-audioworkletnodeoptions defines some more validity constraints.

It's not 100% clear to me whether these constraints should be enforced in just the AudioWorkletNode constructor, or also in the AudioWorkletProcessor constructor (even though that claims to ignore its options arg), or something else.

It would be much clearer if there were a "validate a AudioWorkletNodeOptions" algorithm defined that does the relevant checks and if that algorithm were invoked in the relevant places explicitly.

@hoch hoch self-assigned this Jul 11, 2019
@hoch
Copy link
Member

hoch commented Jul 12, 2019

The option-level validation is:

  • IndexSizeError MUST be thrown if the length of outputChannelCount does not match numberOfOutputs.
  • numberOfInputs = 0, numberOfOutputs = 0: NotSupportedError MUST be thrown by the constructor.

The other validation should be a part of AudioWorkletNode construction:

  • outputChannelCount: A NotSupportedError exception MUST be thrown if a channel count is not in the valid range of an AudioNode's channelCount.
  • [Fixed] parameterData: If the string key of an entry in the list does not match the name of any AudioParam objects in the node, it is ignored.

I'll try to come up with a plan to clarify this.

@hoch
Copy link
Member

hoch commented Aug 13, 2019

parameterData: If the string key of an entry in the list does not match the name of any AudioParam objects in the node, it is ignored.

This is fixed by #2005. The option dictionary does not need to mention this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants