Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AudioStreamInteractive: Pop and mistiming in seamless transitions #94538

Open
Tracked by #76797
Grublady opened this issue Jul 19, 2024 · 0 comments
Open
Tracked by #76797

AudioStreamInteractive: Pop and mistiming in seamless transitions #94538

Grublady opened this issue Jul 19, 2024 · 0 comments

Comments

@Grublady
Copy link
Contributor

Tested versions

Reproduced in 4.3-beta3 and latest master [293c0f7]

System information

Godot v4.3.beta3 - macOS 15.0.0 - Vulkan (Mobile) - integrated Apple M1 Max - Apple M1 Max (10 Threads)

Issue description

Using AudioStreamInteractive, a transition from Clip End to Clip Start with fade disabled between audio files that match up seamlessly creates an audible pop, as well as a time discrepancy.

Here is a timeline with Godot’s audio output (top) alongside the expected concatenation of the original files (bottom):

4 3-beta3

Note the odd waveform shape that occurs in Godot’s audio roughly between markers labeled 1 and 2, which creates a noticeable click sound.
Additionally, although the tracks are in sync prior to the transition (notice the corresponding peaks at marker 0), Godot’s audio drifts out of alignment after the transition (notice the bottom track’s peak at marker 3 corresponding to the top track’s peak at marker 4).

I was able to hack a correction for the time discrepancy by adding an (experimentally-determined) magic number to line 721 in modules/interactive_music/audio_stream_interactive.cpp:

src_fade_wait = end - current_pos + 0.01355;

This change yields the following:

Time-adjusted

The timing is now basically perfectly in sync with the reference track, but the click still occurs roughly between markers 1 and 2.

Steps to reproduce

Run the MRP’s scene, which will autoplay the AudioStreamInteractive and automatically advance clips after ~20sec. Note the click that occurs during this transition.

Minimal reproduction project (MRP)

MRP

Audio Testing.zip

CYA

The attached audio is a copyrighted work included for demonstration purposes only. No license is provided for its usage beyond the scope of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants