DescriptionFixing input handling behavior of ChannelMergerNode
The current implementation of ChannelMergerNode has two critical issues:
1. Impossible to specify input-output mapping due to dynamic channel re-arranging.
https://github.com/WebAudio/web-audio-api/issues/304, crbug.com/441451
2. ChannelMergerNode connected with DelayNode in a cyclic audiograph causes a silent failure of audio rendering.
https://github.com/WebAudio/web-audio-api/issues/459, crbug.com/442925
To address these issues, rtoy@, cwilso@ and hongchan@ proposed a new behavior of ChannelMergerNode:
1. The following properties are fixed for ChannelMergerNode and InvalidState error should be thrown when user changes them.
- ChannelMergerNode.channelCount = 1
- ChannelMergerNode.channelCountMode = ‘explicit’
2. Each input will be summed to mono based on the specified mixing rule.
3. The summed mono channel from input will be transferred to the corresponding output channel (input_1 -> output_channel_1). If an input is not connected (inactive or disconnected), it still counts as one silent channel in output.
Note that the up/downmixing rule is only applied to each input when the channel layout is canonical (mono, stereo, quad, 5.0 and 5.1). For undefined channel layout, the mixing rule automatically changes to 'discrete' mode. That means the merger will just take the first channel and drop the rest.
BUG=441451, 442925
TESTS=4 new tests
audiochannelmerger-cycle.html: to cover the bug 442925
audiochannelmerger-disconnect.html: to cover the bug 441451
audiochannelmerger-input.html: to cover the bug 441451
audiochannelmerger-input-non-default.html: to test the merger with non-default setting
Note that the following laytout test files were removed (or renamed) and merged into the new tests:
channelmerger-basic.html => audiochannelmerger-basic.html
channelmerger-input-handling.html => audiochannelmerger-input.html
channelmerger-cycle.html => audiochannelmerger-cycle.html
channelmerger-channel-limit.html => audiochannelmerger-basic.html
audiochannelmerger-stereo.html => audiochannelmerger-input.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=191723
Patch Set 1 #
Total comments: 32
Patch Set 2 : #
Total comments: 26
Patch Set 3 : #
Total comments: 10
Patch Set 4 : #Patch Set 5 : Add layout tests #
Total comments: 63
Patch Set 6 : #Patch Set 7 : Refactored input test #
Total comments: 4
Patch Set 8 : Fixed nits in layout tests. #Messages
Total messages: 27 (3 generated)
|