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
core: Fix BG music not stopping in Samorost (close #963) #13781
base: master
Are you sure you want to change the base?
Conversation
Thank you for the contribution! Unfortunately this fix is (probably) not the right way to do it. Can you elaborate on what a "sound" is when you stated that the BG music "is not a stream but a sound"? I don't see any EDIT: Whoops, nevermind, there's a |
Are there examples of this in the code that I could use? I wouldn't be able to add it from scratch, only by copying an existing approach. |
@Lord-McSweeney
ruffle/core/src/backend/audio.rs Lines 346 to 347 in fca17a0
ruffle/core/src/backend/audio/mixer.rs Lines 636 to 649 in fca17a0
|
Yes, except this implementation should only stop sounds that were played in a specific |
If a sound has ended by itself or by the game before unloading the movie, would I also need to remove it from the list of per-clip handles? I was unable to find a place when sounds get removed when they simply end, so I don't know how I'd duplicate the removal regarding my duplicate list. |
MovieClip avm1_unload()
was already stopping the current stream at https://github.com/ruffle-rs/ruffle/blob/5bebebddbe3c39362ba520cb0c9c28b3cb7f72a3/core/src/display_object/movie_clip.rs#L2924C18-L2924C18 but in Samorost, the BG music that keeps playing after switching SWFs in ruffle is not a stream but a sound.I don't know how to make it stop only the sound that's currently playing, so here's a "fix" that just stops them all. Technically closes #963 but there may be a neater way.