Skip to content

Set audio volume globally #7690

Closed
Closed

Description

@st0rmbtw

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.

Activity

  1. added
    C-FeatureA new feature, making something new possible
    S-Needs-TriageThis issue needs to be labelled
    on Feb 15, 2023
  2. added
    D-TrivialNice and easy! A great choice to get started with Bevy
    A-AudioSounds playback and modification
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    and removed
    C-FeatureA new feature, making something new possible
    S-Needs-TriageThis issue needs to be labelled
    on Feb 15, 2023
  3. mockersf commented on Feb 15, 2023

    @mockersf
    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?

  4. st0rmbtw commented on Feb 16, 2023

    @st0rmbtw
    ContributorAuthor

    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.

  5. undersquire commented on Feb 16, 2023

    @undersquire

    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.

  6. LiamGallagher737 commented on Feb 16, 2023

    @LiamGallagher737
    Member

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

  7. added a commit that references this issue on Feb 5, 2024
    dff071c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AudioSounds playback and modificationC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with Bevy

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions