Java: the disappearance of music

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

I am using mp3 for playback. With packages: jl1.0, mp3spi1.9.4, tritonus_share-0.3.6. Oh yeah. Volume is not supported in the FloatControll class.

+2


source to share


1 answer


I assume you are trying to get Volume

instead MasterGain

. Try the following:



if (line.isControlSupported(FloatControl.Type.MASTER_GAIN)) {
    masterGain = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
}

      

+2


source







All Articles