godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.1k stars 21.16k forks source link

AudioStreamPlayer: play() resets pitch_scale back to 1 in Web Export #95850

Closed Ivorforce closed 1 month ago

Ivorforce commented 1 month ago

Tested versions

System information

Godot v4.3.stable - macOS 13.6.7 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 XT - 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (16 Threads)

Issue description

In the web export, setting the pitch scale, then playing a sound resets the pitch scale. This was described in #53585 and fixed in #53641. However, the problem persists for me in the web export.

Steps to reproduce

If you play a sound, then set the pitch scale, it plays it correctly:

    talk_sound.play()
    talk_sound.pitch_scale = randf_range(0.15, 0.23)

If you set a pitch scale, then play a sound, it plays it at pitch scale 1 (incorrect):

    talk_sound.pitch_scale = randf_range(0.15, 0.23)
    talk_sound.play()

Minimal reproduction project (MRP)

None yet. I'm a bit busy with a game jam to test it with a minimal reproducer, so if you're busy, wait a few days and I'll test it myself with the reproducer from #53585. It is reproducible in https://github.com/Ivorforce/Built-To-Scale though - specifically https://github.com/Ivorforce/Built-To-Scale/blob/main/scripts/conversation/conversation_box.gd, if adjusted to the faulty setup. The game comes to a dialogue box within a few seconds of starting.

95850.zip

Production edit: added MRP

akien-mga commented 1 month ago

CC @adamscott

adamscott commented 1 month ago

Here's an MRP: 95850.zip