godotengine / godotengine/godot

`AudioEffectPhaser`'s `depth` does not maintain volume

Open
#120,293 0 comments 0 reactions 0 assignees View on GitHub
bug topic:audio
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Tested in v4.7.rc2.official [3df26a02c]
- Reproducible in all versions since 3.0-stable (source of the problem hasn't changed)

### System information

Godot v4.7.rc (72423a57d) - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated Radeon RX 580 Series (Advanced Micro Devices, Inc.; 31.0.21923.1000) - Intel(R) Core(TM) i5-9600KF CPU @ 3.70GHz (6 threads) - 15.91 GiB memory - WASAPI (48000 Hz, Stereo/mono)

### Issue description

Changing the `depth` property in `AudioEffectPhaser` affects volume way more than necessary.
This is because `depth` multiplies the wet signal, and the product is added to the dry signal, without even changing the dry signal's level:

https://github.com/godotengine/godot/blob/df6235838b63dd49f448547406e339848455c140/servers/audio/effects/audio_effect_phaser.cpp#L68

Here's the problem in action:

https://github.com/user-attachments/assets/ee53b167-0685-47fb-8270-b19621cde71f

### Steps to reproduce

- Play any AudioStreamPlayer with any valid stream
- Add `Phaser` to Master bus
- Change `depth`

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start at servers/audio/effects/audio_effect_phaser.cpp around line 68 and reproduce the issue with an AudioStreamPlayer, a valid stream, and Phaser on the Master bus. Trace how changing depth combines the wet and dry signals; done means depth changes no longer cause a disproportionate volume change.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
audio-video-rtc, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.