Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set audio volume globally #7690

Closed
st0rmbtw opened this issue Feb 15, 2023 · 4 comments · Fixed by #7706
Closed

Set audio volume globally #7690

st0rmbtw opened this issue Feb 15, 2023 · 4 comments · Fixed by #7706
Labels
A-Audio Sounds playback and modification C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@st0rmbtw
Copy link
Contributor

st0rmbtw commented Feb 15, 2023

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

When you want to create a sound volume control system in your game It becomes really inconvenient to provide a volume to every audio.play_with_settings() call. So it would be nice to provide a way to set sound volume globally to avoid boilerplate code.

Additional context

Also, it would be nice to have a possibility to set a volume to a specific sound type (e.g. Music, Weather, Ambient) in your game.

@st0rmbtw st0rmbtw added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Feb 15, 2023
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-Audio Sounds playback and modification C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Feb 15, 2023
@mockersf
Copy link
Member

global volume could be in a resource

There is one open question: if a global volume is set, should the volume set when using play_with_settings be absolute and ignore the global volume settings, or relative to it?

@st0rmbtw
Copy link
Contributor Author

I think it should be relative to a global volume. Though, we can add two functions which would respect a global volume and do not.

@undersquire
Copy link

I think there should be two functions: play_with_settings and play_with_relative_settings (or something) that makes it explicit what the behavior is.

@LiamGallagher737
Copy link
Member

LiamGallagher737 commented Feb 16, 2023

I'm going to have a go at this one, I'll let you know if I give up.
I did not 😁

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Audio Sounds playback and modification C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants