Connecting a bufferSource to an audioWorklet causes an unexpected buzzing saw-like sound
Reported by
janescon...@gmail.com,
May 3 2018
|
||||
Issue descriptionChrome Version : 66.0.3359.139 OS Version: 10.0 URLs (if applicable) : https://jsfiddle.net/kk7w6bet/3/ Other browsers tested: N/A What steps will reproduce the problem? 1. Create an AudioWorklet with no inputs connected, which just generates sound. 2. Create a stereo bufferSource - its content don't matter 3. Connect the bufferSource to the AudioWorklet - playing it is not needed. Test case is here: https://jsfiddle.net/kk7w6bet/3/. Load the page to execute steps 1 and 2, then press the "Start Buffer" button to execute step 3. What is the expected result? The worklet should continue generating sound What happens instead of that? A buzzing-like sound is heard instead. Please provide any additional information below. Attach a screenshot if possible. UserAgentString: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36 This might be related to https://webaudio.github.io/web-audio-api/#configuring-channels-with-audioworkletnodeoptions - looks like a bug when the worklet transitions from mono ("if outputChannelCount is unspecified, it will be mono for all outputs") to stereo ("If outputChannelCount is unspecified, the output channel count will match computedNumberOfChannels from the input")
,
May 4 2018
,
May 4 2018
,
May 4 2018
As Hongchan suspected, it's a bug in the worklet process. You update this.time in the inner most loop. If you have multiple channels (which happens when you start the stereo buffer), each channel now gets a piece of the sine wave. When they get played, channel 0 has discontinuous pieces of the sine wave and so dow channel 1. Hence the buzziness. If you rearrange the code so the for each channel, this.time is reset to the starting value, I think everything will work out.
,
May 4 2018
WontFix (WAI). It's bug in the user code. A very common mistake to make when you're not used to dynamic changes in the number of channels being processed. |
||||
►
Sign in to add a comment |
||||
Comment 1 by janescon...@gmail.com
, May 3 2018