godotengine / godotengine/godot

AudioStreamPlayer pitch_scale ignored in Web unless tweened

Open
#97,704 1 comment 2 reactions 0 assignees View on GitHub
bug platform:web topic:audio
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

v4.3.stable.official [77dcf97d8]
Chrome and Safari stable on M1 Mac.
Brave on Android.

### System information

Godot v4.3.stable - macOS 13.0.1 - Vulkan (Mobile) - integrated Apple M1 - Apple M1 (8 Threads)

### Issue description

Setting `AudioStreamPlayer.pitch_scale` has no effect on Web. Tweening it causes it to work, including tweening to the same value you just set it to, like

```swift
player.pitch_scale = 1.5 # optional
create_tween().tween_property(player, "pitch_scale", 1.5, .01)
```

`AudioStreamPlayer2D` does not have this bug.

### Steps to reproduce

1. Open attached test project
2. Run in Godot, click each of the buttons. Each causes a normal ding and a high ding.
3. Export to Web and run in a browser (e.g. via Remote Debug), or test at https://sorryrobot.com/pitchey .

Expected behavior:
All buttons play a low ding then a high ding on Web.

Actual behavior:
All buttons work except for the first, which plays 2 normal dings. (This button is setting `.pitch_scale` on an `AudioStreamPlayer` and not tweening.)

### Minimal reproduction project (MRP)

[test.zip](https://github.com/user-attachments/files/17213484/test.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached minimal reproduction project and compare the direct pitch_scale assignment with the tweened assignment in the Web export. Reproduce the behavior in a browser, then trace the AudioStreamPlayer Web path. Done means direct pitch_scale changes produce the expected pitch on Web, matching the other buttons and AudioStreamPlayer2D behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.