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

Ability to change AudioSource in AudioSink #12824

Open
Aunmag opened this issue Apr 1, 2024 · 2 comments
Open

Ability to change AudioSource in AudioSink #12824

Aunmag opened this issue Apr 1, 2024 · 2 comments
Labels
A-Audio Sounds playback and modification C-Usability A simple quality-of-life change that makes Bevy easier to use

Comments

@Aunmag
Copy link

Aunmag commented Apr 1, 2024

What problem does this solve or what need does it fill?

For better performance I try to limit amount of audio sources and spawn a few audio sinks at startup once. I've implement a queue for sounds that need to be played with priority and it checks if there's available audio sink. The problem is that I sill need to spawn/despawn entity with audio bundle for each sound.

What solution would you like?

I need an ability to reuse an existing AudioSink for playing new sounds without recreating it.

What alternative(s) have you considered?

None

Additional context

In my case I play a lot of footsteps sounds for player and enemies, when there are more than 200 enemies it may affect the performance. Plus gunshots and other audio effects.

@Aunmag Aunmag added C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels Apr 1, 2024
@matiqo15 matiqo15 added A-Audio Sounds playback and modification C-Usability A simple quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled C-Enhancement A new feature labels Apr 1, 2024
@SolarLiner
Copy link
Contributor

I would hold on until the switch to Kira as the audio backend, first to see if the performance is better and then to see how to provide ways for users to do this kind of resource management. Further, the current audio systems are constantly doing archetype moves by inserting and removing components, although I don't know how much of it we can't work around.

@mweatherley
Copy link
Contributor

Popping in here to also mention that a significant blocker of this is that rodio's spatial audio sinks cannot presently be reused. I wrote a PR for that while investigating the possibility of reusing audio sinks in our current audio setup, but they haven't released a new version that includes it yet.

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-Usability A simple quality-of-life change that makes Bevy easier to use
Projects
Status: Open
Development

No branches or pull requests

4 participants