Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Java Sound

Sign in to follow this  


After working and working at getting a better SoundManager class I finally made one that works with the JLayer library. It has some better functionality such as playing at a given spot within a song, changing volume, and even crossfade between two sound clips.

There is still a minor issue with buffering the files before playing. Currently you do a SoundManager.play("somemusic.ogg",0,null) to play some music, but it takes some time to load the file from disk.

The answer is to make a SoundCache object which would take input like SoundCache.load("SomeMusic.ogg"); and then SoundManager.play(SoundCache.load("SomeMusic"),0,null); All I have to do now is implement it [smile]
Sign in to follow this  

1 Comment

Recommended Comments

And maybe implement some sort of max. number of cached sounds manager which frees the less used sounds. By the way, my (very small and basic) game console framework is done. Too bad you ain't using Java 5. :D

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!