godotengine / godotengine/godot

Invalid parameters on audio effect silences audio completely instead of throwing errors

Open
#110,613 4 comments 0 reactions 0 assignees View on GitHub
discussion enhancement topic:audio
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducable on Windows 11, Godot 4.4.1 and 4.5

### System information

Godot v4.5.stable - Windows 11 (build 26100) - Multi-window, 3 monitors - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 5050 Laptop GPU (NVIDIA; 32.0.15.7659) - 13th Gen Intel(R) Core(TM) i5-13450HX (16 threads) - 23.71 GiB memory

### Issue description

Recently spent way to much time tracking down a bug because it lacked any errors.

Some place in my code I had accidentally set an AudioEffectReverb's paremeter room_size to be NaN.
Each time reverb was to be applied it instead silenced every sound in the game for its duration, before then returning all to normal.

Would be convenient if it instead threw an error, indicating that the room_size value was invalid. It seems dangerous that it just fails silently.

### Steps to reproduce

1) Create project with an audio player and any stream.
2) Alternatively, also add an autoplaying background track.
3) At Audio tab add a reverb effect
4) In code, set reverb's room_size to a NaN value and play the AudioPlayer.
5) Observe as the audio mutes itself (both the played player as well as the background track) with no error indicating what's wrong.

### Minimal reproduction project (MRP)

no

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.