New issue
Advanced search Search tips

Issue 839638 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Connecting a bufferSource to an audioWorklet causes an unexpected buzzing saw-like sound

Reported by janescon...@gmail.com, May 3 2018

Issue description

Chrome 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")

 
Looks like a mono -> stereo problem as described above and specified in https://webaudio.github.io/web-audio-api/#configuring-channels-with-audioworkletnodeoptions

To prove that, I made another fiddle where I connect a mono buffer and the bug *does not* happen: https://jsfiddle.net/934huvzs/2/


Labels: Needs-Triage-M66

Comment 3 by rtoy@chromium.org, May 4 2018

Components: Blink>WebAudio
Status: Available (was: Unconfirmed)

Comment 4 by rtoy@chromium.org, 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.

Comment 5 by rtoy@chromium.org, May 4 2018

Status: WontFix (was: Available)
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