2
votes

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.

1
I mean: Why did you gave me -1 ?Martijn Courteaux
Here is a tip: remove the part about "making Braid in Java". It sounds a bit childish.amarillion

1 Answers

2
votes

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);
}