2

I'm making a game. Now if my player goes to another level the music is still playing. Now I want to let the music fade out to let start the new music of the next level.

I use mp3 to play. With the packages: jl1.0, mp3spi1.9.4, tritonus_share-0.3.6. Oh yeah. Volume is not supported in the FloatControll class.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287

1 Answers1

2

I suppose you're trying to get Volume control instead of MasterGain. Try this:

if (line.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
    masterGain = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
}
Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68