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 with autoplay enabled does not play wav in exported project #45355

Open
Tracked by #76797
apeyrard opened this issue Jan 21, 2021 · 7 comments
Open
Tracked by #76797

Comments

@apeyrard
Copy link

Godot version:
v3.2.3

OS/device including version:
Arch linux

Issue description:
I added an AudioStreamPlayer to a scene. I set a wav file as its stream.
When running the scene in the IDE, the sound plays.

When exporting the project on linux, and executing it with the command line, the sound does not play, and the finished() event is not emitted.

Steps to reproduce:
Create a new project
Add an AudioStreamPlayer to it
Add a wav file to the AudioStreamPlayer
Export the project on linux
Execute the exported file

Minimal reproduction project:
bug_reproduction.zip

@Calinou
Copy link
Member

Calinou commented Jan 21, 2021

For the record, the same question was also posted here: https://www.reddit.com/r/godot/comments/l1ze48/audio_not_playing_in_exported_project/

The issue here seems to be that the autoplay property in AudioStreamPlayer has no effect in the exported project. I don't know what could be causing this.

I can reproduce this to an extent on 3.2 Git 40b3546. The sound always plays when running the project from the editor. If you run the project using a release export template, the sound will sometimes play but with a significant delay.

@Calinou Calinou changed the title AudioStreamPlayer does not play wav in exported project AudioStreamPlayer with autoplay enabled does not play wav in exported project Jan 21, 2021
@apeyrard
Copy link
Author

Hello,

Yes, I decided to open an issue since I was able to create a small project reproducing it, so it looked like a real bug.

I am not sure if the autoplay property is the one causing it, because in my initial project, the AudioStreamPlayer was not autoplay, but was triggered by a script, and the bug happened there too.

@Calinou
Copy link
Member

Calinou commented Jan 21, 2021

@apeyrard Does it work if you delay the sound playback by 100-200 milliseconds?

Also, does it work on another platform like Windows or Android?

@apeyrard
Copy link
Author

apeyrard commented Jan 21, 2021

Since I am not sure what you meant by delaying it (I dont see a delay option in the AudioStreamPlayer, so I'm guessing you mean programatically), here is another minimal project where a button triggers AudioStreamPlayer.play()

The same happens for me in linux: it works in the IDE, but not when exported.

bug_reproduction.zip
Exporting in windows, for windows works without the issue.
Exporting in windows, for linux, then executing in linux also works

@apeyrard
Copy link
Author

I found a new behaviour on linux: If i close the godot IDE and then execute the export (both exports from windows and linux), the sound plays.

However, if the IDE is open, in both cases, the sound doesn't play.

@apeyrard
Copy link
Author

Apparently this was a problem with Alsa and pulseaudio.

I fixed this by using the AUR godot-pulse package

@Calinou, since you apparently found a problem with "autoplay" should I close this ? There is no issue anymore on my side, and godot was not the culprit after all.

@Calinou
Copy link
Member

Calinou commented Jan 26, 2021

We should still aim to fix this when using ALSA.

On a separate note, I wish the godot AUR package used PulseAudio by default (with the bare ALSA package moved to godot-alsa)…

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