You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Needs EditsDecision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/
After some thoughts, it actually brings up more questions.
Unlike the factory methods (i.e. context.createFoo()), the constructor method without '...Node' in the name seems to too short for some nodes. For example, new Gain() or new GainNode(), which one de we prefer?
The destination node automatically is instantiated at the moment of AudioContext construction, so we might want to include these options into the AudioContext's constructor option.
I don't think AudioNodeOptions should have numberOfInputs and numberOfOutputs. For most nodes these aren't changeable. Only splitter/merger and script processor have such options, right?
Also, is GainNode too generic? Is AudioGainNode too verbose?
@bill-hofmann Yes. That's what I am thinking too. However, we changed the factory method from 'createGainNode()' to 'createGain()' so just wanted to ask what we want.
@rtoy I just put them there for the formality, but we still need to decide how a node should behave when invalid properties are given. Also AudioGainNode() is something I would like to avoid...
What do you mean by invalid properties? Shouldn't unknown properties be ignored and invalid values for a property signal the same errors (or not) as setting the attributes would?
By 'an invalid property', I meant something like passing a number for a string-type attribute. Do we silently ignore this error without throwing anything? Hmm, personally I don't think that's the right thing to do, but I would like to have opinions from TAG.
Needs EditsDecision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/
Why? By combining them into one, it looks like you can change numberOfInputs and numberOfOutputs for any node. But for most nodes you can't. I think ChannelMerger, ChannelSplitter, and ScriptProcessor are the only nodes that let you change either of these.
If you don't separate them, you get to explain in almost every constructor why you can have {numberOfInputs: 5} and not have 5 inputs to that node.
Also the constructor option for PannerNode probably shouldn't derive from AudioNodeChannelOptions since you can't change any of them.
And it's a bit confusing for ChannelMerger. You can set the numberOfInputs, but numberOfOutputs has no effect. Perhaps ChannelMergerOptions shouldn't derive from AudioNodeIOCountOption. Similarly for ChannelSplitterNode.
After thinking this over, I think there should not be an AudioIOCountOptions dictionary. For every node, the constructor options dictionary should inherit from AudioNodeChannelOptions to allow the constructor to set the appropriately. Of course, the normal rules for the node should apply. Thus, you can set channelCount: 7 in the dictionary, but this would throw an error when constructing a PannerNode since that's illegal.
For ChannelMergerNode and ChannelSplitterNode, the constructor dictionaries would look something like
Needs EditsDecision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/
Activity
hoch commentedon Jan 15, 2016
I prefer to be able to set them in the property bag. Currently the code quickly becomes messy with lots of repetition.
For throwing exceptions, I also prefer to 'fail early with a specific error message'.
hoch commentedon Feb 16, 2016
Well, to get the ball rolling -
dictionary AudioNodeOptions { numberOfInputs = 1; numberOfOutputs = 1; channelCount = 2; channelCountMode = "max"; channelInterpretation = "speakers"; }; [Constructor(AudioContext audioContext, optional AudioNodeOptions audioNodeOptions)] partial interface AudioNode { }An example would be:
After some thoughts, it actually brings up more questions.
context.createFoo()), the constructor method without '...Node' in the name seems to too short for some nodes. For example,new Gain()ornew GainNode(), which one de we prefer?billhofmann commentedon Feb 17, 2016
I think
new GainNode()is more "fluent".rtoy commentedon Feb 17, 2016
I don't think AudioNodeOptions should have numberOfInputs and numberOfOutputs. For most nodes these aren't changeable. Only splitter/merger and script processor have such options, right?
Also, is GainNode too generic? Is AudioGainNode too verbose?
hoch commentedon Feb 17, 2016
@bill-hofmann Yes. That's what I am thinking too. However, we changed the factory method from 'createGainNode()' to 'createGain()' so just wanted to ask what we want.
@rtoy I just put them there for the formality, but we still need to decide how a node should behave when invalid properties are given. Also AudioGainNode() is something I would like to avoid...
rtoy commentedon Feb 17, 2016
What do you mean by invalid properties? Shouldn't unknown properties be ignored and invalid values for a property signal the same errors (or not) as setting the attributes would?
hoch commentedon Feb 17, 2016
By 'an invalid property', I meant something like passing a number for a string-type attribute. Do we silently ignore this error without throwing anything? Hmm, personally I don't think that's the right thing to do, but I would like to have opinions from TAG.
padenot commentedon Feb 24, 2016
This is something that would be taken care of by WebIDL.
mdjp commentedon Apr 7, 2016
F2F: Yes we will include these properties inthe property bag
rtoy commentedon May 20, 2016
I think the AudioNodeOptions dictionary should be separated into two parts:
and
Why? By combining them into one, it looks like you can change
numberOfInputsandnumberOfOutputsfor any node. But for most nodes you can't. I thinkChannelMerger,ChannelSplitter, andScriptProcessorare the only nodes that let you change either of these.hoch commentedon May 20, 2016
Note that it conflicts with what I have in here.
I can see why it is necessary, but not sure about having two different dictionaries for such small task.
rtoy commentedon May 20, 2016
If you don't separate them, you get to explain in almost every constructor why you can have
{numberOfInputs: 5}and not have 5 inputs to that node.Also the constructor option for
PannerNodeprobably shouldn't derive fromAudioNodeChannelOptionssince you can't change any of them.And it's a bit confusing for
ChannelMerger. You can set thenumberOfInputs, butnumberOfOutputshas no effect. PerhapsChannelMergerOptionsshouldn't derive fromAudioNodeIOCountOption. Similarly forChannelSplitterNode.rtoy commentedon Jun 28, 2016
After thinking this over, I think there should not be an
AudioIOCountOptionsdictionary. For every node, the constructor options dictionary should inherit fromAudioNodeChannelOptionsto allow the constructor to set the appropriately. Of course, the normal rules for the node should apply. Thus, you can setchannelCount: 7in the dictionary, but this would throw an error when constructing aPannerNodesince that's illegal.For
ChannelMergerNodeandChannelSplitterNode, the constructor dictionaries would look something likeFix WebAudio#697: AudioNode channel options dictionary
Merge pull request #863 from rtoy/697-audio-node-channel-options