Author Topic: Problem with music volume slider  (Read 658 times)

Gribbler

  • Posts: 1,489
  • I'm selling these fine leather jackets.
    • Gribbler worked on a game that won an AGS Award!
    •  
    • Gribbler worked on a game that was nominated for an AGS Award!
Problem with music volume slider
« on: 12 May 2014, 22:45 »
My music volume slider doesn't work. I'm using default AGS GUI panel (sierra type). Slider code:

Code: Adventure Game Studio
  1. function sldMusic_OnChange(GUIControl *control)
  2. {
  3.   SetMusicMasterVolume(sldMusic.Value);  
  4.  
  5. }
No matter what position slider is in, the volume doesn't change.

Slider for sound however works fine. Here's its code:
Code: Adventure Game Studio
  1. function sldSound_OnChange(GUIControl *control)
  2. {
  3.   SetSoundVolume(sldSound.Value);
  4. }

I've consulted manual and everything should work. What am I doing wrong? Both sounds and music are added in their respective folders in audio section in the editor. I tried changing music prority but it doesn't help. I just don't understand how the music is handled. I've searched the forums and found some posts regarding master volume handling but I still don't get it. Sorry for being dumb! :)

Could anyone help me with this or maybe point in the right direction? (not off a Cliff :) )

Khris

  • Posts: 10,676
  • having to deal with what games are going through
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on a game that was nominated for an AGS Award!
Re: Problem with music volume slider
« Reply #1 on: 13 May 2014, 03:30 »
Since AGS 3.2, it's
Code: Adventure Game Studio
  1.   Game.SetAudioTypeVolume(eAudioTypeMusic, sldMusic.Value, eVolExistingAndFuture);

Gribbler

  • Posts: 1,489
  • I'm selling these fine leather jackets.
    • Gribbler worked on a game that won an AGS Award!
    •  
    • Gribbler worked on a game that was nominated for an AGS Award!
Re: Problem with music volume slider
« Reply #2 on: 13 May 2014, 09:32 »
It works! Thanks so much, Khris!