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

AudioStreamPlayer "finished" signal is never emitted if there is no audio output device #71640

Closed
Tracked by #76797
tcoxon opened this issue Jan 18, 2023 · 0 comments · Fixed by #87010
Closed
Tracked by #76797

Comments

@tcoxon
Copy link
Contributor

tcoxon commented Jan 18, 2023

Godot version

3.5.1.stable

System information

Windows 10, GLES3, NVIDIA GTX 970, driver version 31.0.15.1694

Issue description

The AudioStreamPlayer node's "finished" signal is never emitted if the system has no audio output device. I tested this by unplugging all headphones and line out devices from my machine, and then starting my project. My intuition is that having no output device should functionally equivalent to muting the game, however this is not the case. If the game is muted (but still has an output device) the "finished" signal is still emitted.

If you don't know that the lack of an audio output device causes this signal to never be emitted, and you yield on the signal in code, this can easily lead to severe game-breaking bugs.

I guess it makes some kind of sense that no audio can be played without an audio output device, however the is_playing method on AudioStreamPlayer does return true even when there is no output device.

I have not tested AudioStreamPlayer3D or AudioStreamPlayer2D, but they are probably affected too.

Steps to reproduce

Sample code:

$AudioStreamPlayer.stream = preload("some audio file.wav")
$AudioStreamPlayer.play()
yield($AudioStreamPlayer, "finished")
print("This line is never printed")

Unplug all your headphones and speakers, and then run the code. The print statement is never executed.

Minimal reproduction project

N/A

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