I have been developing a simple java game, however I would like to add some Music to my game because it seems quite boring whenever you play it.

Re: How do I add Music to my Java game. 80 80

tons of way. depends on the version of Java you are using, the type of audio file you want to play, whether we are talking about background music or sound-effects, ...

Re: How do I add Music to my Java game. 80 80

Java support for media has beena shambles inthe past - JMF never worked properly.
The good news is that JavaFX is now a standard component in all the current versions of JavaSE. JavaFX has excellent support for media.
See this recent thread - especially the last two posts

Re: How do I add Music to my Java game. 80 80

You can download nova flux

It has useful tools for playing Ogg Files. You would want to use the OggManager from the audio package

to Load the Ogg you would want to say:

to play the Ogg you would say:

The Library is designed to make games but if you just want to use the audio features it should work just fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.