-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Can't play the same song twice #836
Comments
Thank you for your reporting your first LITIENGINE issue! We are looking forward to your further contributions. |
Thanks for the report! // considering there is already a Sound Resource with the music you want to play, use the String parameter for `playMusic`.
Game.audio().playMusic("endless-nights.ogg");
// access the MusicPlayback
MusicPlayback mp = Game.audio().getMusic();
// pause and resume
mp.pausePlayback();
mp.resumePlayback();
// stop and restart
mp.cancel();
mp.run(); |
It's a "slide-based" approach. There are some different slides defined in a JSON file. If one slide is loaded a new screen for the slide is started and a music resource would be played. In some cases two slides with the same music comes successively. Sure, technically I can check if the music file is the same and only restart it, but from the outer view if I start a music via Game.audio().playMusic I want that the engine plays the music instead of being silent. |
In that case, this is not a bug. You can simply use |
Implemented and tested, works perfect. Thanks :) |
awesome - happy coding! |
Describe the bug
If i want play a song twice (play song, stop it, play it again), the second attempt doesn't work. It need to play another song first to play the first song again.
To Reproduce
Expected behavior
Song should be started, then stopped, then again started.
Your System:
The text was updated successfully, but these errors were encountered: