Question

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.

Was it helpful?

Solution

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);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top