Forum rules - please read before posting.

How to change music volume?

I've looked around the forum and not a single discussion on this...

I know that you can set each track volume when you add it to the tracks list and the main music volume, but what if I want the music currently playing to go to half its volume for a moment (say, while some cutscene is triggered that relies on other sounds etc), is that even possible? - you can do that with sound effects by changing volume of sound objects, but with music it's also quite essential I think? ;)

Please help me understand this ;)

Comments

  • The global music volume, or a specific track?  You can do both with custom scripting:

    Global (options data):
    AC.KickStarter.options.SetVolume (VolumeType.Music, 0.5f); // 0.5f = mid-volume

    Sound / Music component:
    mySoundComponent.SetVolume (0.5f);
  • Thanks ;) All right, I'll experiment with that. I meant the track volume, but I guess changing global would do the same, as I wouldn't want to change it permanently, just for a cutscene or so, and then bring it back up.

    Still, might be worth considering adding it in one of the future updates ;)

    PS. Making great progress with my game (got about 1 hour playtime already) and totally in love with AC :)
  • Glad to hear it!

    FWIW, a custom Action could allow you to do this for any Sound object you like.
  • Sorry for the necroposting, but the topic is very appropriate and will be quickly found in the search engines if someone has the same question.

    Is AC has a standard Action for manipulating volume of "Sound: Play music/Play ambience"?
    Something like "Sound: Change volume" for an old music system?

  • edited March 16

    If you're looking to set the volume of all music, and not a specific Sound object, then you need to change the "Music" volume. The same goes for ambience and SFX volumes.

    If you rely on Audio Mixer groups for audio playback (see this tutorial), you can create a mixer group in between your Master and Music, create a snapshot that changes the volume, and control that with the Sound: Set mixer snapshot Action.

    Alternatively, you can update the global "Music" volume through scripting:

    float newVolume = 0.5f; // between 0 and 1
    AC.Options.SetMusicVolume (newVolume);
    

    However, the upcoming v1.67.0 update will include a new Save: Set Option Action, which will allow you to set option values within ActionLists.

  • I played a little with snapshots, and it worked for me.
    Thank you.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.