PitchShift doesn't work in web build

Godot Version

4.3 (also tried 4.6.3)

Question

I’m playing an audio (voice) file and want the player to be able to change the speed. I’m doing this by turning up the PitchScale in the AudioStreamPlayer2D and turning down the PitchShift in the associated bus effect.

This works fine in the Godot editor, but when I play it from a web build (on itch.io), speeding it up increases the speed without the pitch compensation, so it sounds like Alvin & the Chipmunks.

Why would the web build behave differently? Is there a workaround?

Try changing the playback type to “Stream”.

The default for web exports is “Sample”, which doesn’t support AudioEffects. Changing it to “Stream” may increase latency though.

Found a solution: It was crucial that each AudioStreamPlayer2D had a playback type of Stream.

This can also be set in Project Settings > Audio > General. We thought we had already changed this, but when we looked the web default was at “sample”. Possibly setting it in either place works.

(It looks like we figured this out just as hyvernox was posting an answer.)