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

Despawning audio entity does not stop the sound #9324

Closed
Cyborus04 opened this issue Jul 31, 2023 · 5 comments · Fixed by #9336
Closed

Despawning audio entity does not stop the sound #9324

Cyborus04 opened this issue Jul 31, 2023 · 5 comments · Fixed by #9336
Labels
A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior
Milestone

Comments

@Cyborus04
Copy link

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 the AudioSink would solve this, but I haven't tried that yet.

@Cyborus04 Cyborus04 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 31, 2023
@alice-i-cecile alice-i-cecile added A-Audio Sounds playback and modification and removed S-Needs-Triage This issue needs to be labelled labels Jul 31, 2023
@alice-i-cecile
Copy link
Member

I agree that this is how it should work.

@Cyborus04
Copy link
Author

woah you're fast to respond haha

@alice-i-cecile
Copy link
Member

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.

@Cyborus04
Copy link
Author

Running .stop() on the audio sink before deleting it did work around it. Not surprising, but I thought I'd confirm it in case anyone else needs it.

github-merge-queue bot pushed a commit that referenced this issue Aug 11, 2023
# 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.
@Cyborus04
Copy link
Author

should this be under the 0.11.1 milestone?

@cart cart added this to the 0.11.2 milestone Aug 16, 2023
cart pushed a commit that referenced this issue Aug 17, 2023
# 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.
@SolarLiner SolarLiner added this to Audio Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Audio Sounds playback and modification C-Bug An unexpected or incorrect behavior
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants