1
\$\begingroup\$

I have been searching everywhere for master volume for sound and music in LibGDX but to no avail. Can anyone tell me if it is implemented somewhere or do i need to implement such functionality myself? Thanks in advance.

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$

I'm pretty new to LibGDX but I don't think it would be too hard to implement your own version of a "master volume" - just have a float variable called master volume and then use it whenever you play your music and edit it how you please.

For example:

public static float mastervol = 1f;

//playing your sounds
sound1.play(mastervol);
sound2.play(mastervol);

//change your master vol
public void setMasterVolume(float i){mastervol = i;}

Something along those lines.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you Jonathan, i created my own and it's working perfectly! :D \$\endgroup\$
    – AVariable
    Commented Jul 8, 2014 at 10:43
  • 1
    \$\begingroup\$ @AVariable If you did what he suggested and it worked, then mark his answer as the accepted one! \$\endgroup\$ Commented Jul 9, 2014 at 13:28
  • \$\begingroup\$ @AVariable just click the checkmark next to the number on the side of this answer \$\endgroup\$
    – ashes999
    Commented Jul 10, 2014 at 14:20
  • \$\begingroup\$ I did it! :D i'm pretty knew to stackexchange, thanks guys! \$\endgroup\$
    – AVariable
    Commented Jul 10, 2014 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .