Repository navigation
fix(audio-context): iOS targeted disconnect, per-connection channel mixing, splitter/merger and connect(AudioParam) - #286
Merged
Merged
Conversation
…ixing, splitter/merger and connect(AudioParam) - disconnect(destination), disconnect(output), disconnect(destination, output, input) and disconnect(param) remove only the matching connections (NSCConnectAdding / NSCDisconnectRemoving); connecting to a node no longer drops the source's other connections. - NSCChannelMixerNode gives every connection its own bus at its source's channel count and mixes with the Web Audio speaker rules (1, 2, 4, 6 channels) or discretely. Each AudioWorkletNode input mixes through one at its own channelCount, and a buffer with more channels than the context plays all of them. - ChannelMergerNode puts each input on its channel. ChannelSplitterNode plays each output from its own node: AVAudioEngine drops a unit's other output connections when one output bus is connected, which silenced splitter output 0. - Params take an input block filled by a sink each render. BiquadFilterNode is Chromium's per-frame biquad, so frequency, Q, gain and detune take audio every frame, as do oscillator frequency and detune, ConstantSourceNode.offset, AudioBufferSourceNode playbackRate and detune and the params of a worklet with inputs. StereoPannerNode.pan, PannerNode position and orientation and the params of a worklet without inputs follow audio once per quantum. - Specs: the splitter-into-filter and worklet speakers specs run on iOS; new specs for targeted disconnects and per-frame param inputs. audio-graph's feedback-loop and explicit channelCount specs stay skipped on iOS (a cycle hangs AVAudioEngine; gains take no channelCount).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
ℹ️ Note: npm publishing is disabled for pull requests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iOS catches up with the Web Audio routing the specs check: targeted disconnects, per-connection channel mixing, a real ChannelSplitterNode/ChannelMergerNode and
AudioNode.connect(AudioParam)on most params.Routing
disconnect(destination),disconnect(output),disconnect(destination, output, input)anddisconnect(param)remove only the matching connections. Connecting to a node no longer drops the source's other connections.NSCChannelMixerNode(an in-process AUAudioUnit) gives each connection its own bus at its source's channel count and mixes with the speaker rules (1, 2, 4, 6 channels) or discretely.AudioWorkletNodeinput mixes through one at its ownchannelCount.ChannelMergerNodeputs each input on its channel.ChannelSplitterNodeplays each output from its own node. AVAudioEngine drops the connections of a unit's other output buses when one output bus is connected, which silenced splitter output 0.connect(AudioParam)
GainNode.gain,DelayNode.delayTimeBiquadFilterNodeparams (now Chromium's per-frame biquad)frequencyanddetuneConstantSourceNode.offsetAudioBufferSourceNode.playbackRateanddetuneStereoPannerNode.pan,PannerNodeposition/orientation, and the params of a worklet without inputs.Specs (iOS simulator,
audiosuite: 58 passed, 0 failed, 2 skipped)disconnect(node)keeps the source's other connectionsdisconnect(output)disconnect(node, output, input)disconnect(param)channelCountgain spec fails (a gain takes nochannelCount).Limits
PannerNode's own connect still uses the old routing, which cuts the source's other outputs.AudioWorkletNodeis still one unit with several output buses, so connecting more than one of its outputs may hit the same AVAudioEngine behaviour.Android
These specs now run on Android too, except four skipped there for Android bugs that this PR does not fix:
disconnect(output)anddisconnect(node, output, input): disconnecting a splitter output on Android silences realtime worklet contexts created later in the suite.OscillatorNode.frequencyparam input: the oscillator drifts from the automated reference.BiquadFilterNode.frequencyparam input: Android biquad params ignore audio.Android
audio: 56 passed, 0 failed (Pixel_9_Pro). iOSaudio: 58 passed, 0 failed.