godotengine / godotengine/godot

`AudioStreamWAV` missing `has_loop()` override

Open
#118,366 0 comments 6 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

4.7 dev

### System information

Windows 10

### Issue description

There is inconsistency in how different `AudioStream` implementations handle looping information. While formats like MP3 and OggVorbis implement the `loop` property and `has_loop()` method, `AudioStreamWAV` lacks this implementation entirely. Instead, it relies on a unique `loop_mode` property.

Because `AudioStreamWAV` does not override the virtual `has_loop()` method from the base `AudioStream` class, it always returns the default value (false), even when the WAV file is set to loop.

Some engine systems work with the base `AudioStream` class and rely on its common interface to determine stream behavior. The absence of a proper `has_loop()` override in the WAV implementation leads to logical failures in these systems.
Example:
In the `AudioStreamInteractive`. When performing a transition from a looping WAV track without a fade (see issue: #117855)

### Related Issue:
This problem is directly causes the behavior described in:
Issue #117855

### Steps to reproduce

See Issue: #117855

### Minimal reproduction project (MRP)

See Issue: #117855

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the AudioStream base interface and comparing the AudioStreamWAV implementation with the MP3 and OggVorbis implementations. Review AudioStreamInteractive and related issue #117855 to understand the failing transition behavior. Done means base AudioStream callers can correctly detect looping WAV tracks; verify with the reproduction from issue #117855.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.