-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Despawning audio entity does not stop the sound #9324
Comments
I agree that this is how it should work. |
woah you're fast to respond haha |
IIRC, this is going to be quite challenging to make work based on how the current audio backend works. My recollection is that it spawns and detaches audio tasks. |
Running |
# Objective - Fixes #9324 - Audio sinks used to have a custom drop implementation to detach the sinks because it was not required to keep a reference to it - With the new audio api, a reference is kept as a component of an entity ## Solution - Remove that custom drop implementation, and the option wrapping that was required for it.
should this be under the 0.11.1 milestone? |
# Objective - Fixes #9324 - Audio sinks used to have a custom drop implementation to detach the sinks because it was not required to keep a reference to it - With the new audio api, a reference is kept as a component of an entity ## Solution - Remove that custom drop implementation, and the option wrapping that was required for it.
Bevy version
Bevy 0.11
What you did
Create an entity with
AudioBundle
, then despawn it.Example (note: you'll need to put your own song at
./assets/song.mp3
. I didn't want to hassle with song licensing)What went wrong
I expected this to stop the music from playing. It, however, kept going.
Additional information
Discord discussion where I was suggested to make a bug report
I imagine manually
.stop()
-ing theAudioSink
would solve this, but I haven't tried that yet.The text was updated successfully, but these errors were encountered: