• Advertisement
Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65749

Preferences Editor, and SoundManager

Sign in to follow this  

271 views



I know that a bunch of you may be getting board with all my GUI shots, but at least you know I'm still working away on stuff. Besides getting the preferences editor done I also worked a bunch on my SoundManager class. It can handle more than one MP3 playing at the same time (as long as they are not the same MP3) and as many midi/wav files that you want at a time (including the same one as many times if you want).

When I go 'SoundManager.play("Test.mp3");' it loads Test.mp3 from my AudioCache right into the SoundManager, so before using sounds you must cache them. This is one of the responisbilities of the State.init() and State.dispose() methods. When I want to stop a file that is playing, I have to know it's internal ID number. This int value is returned when you invoke play() or loop().

Here is a sample use:
int ID = SoundManager.loop("BgMusic.mp3");
SoundManager.loop("SoftWind.mp3");
//WAIT UNTIL TRIGGER
SoundManager.stop(ID);
SoundManager.play("Explosion.wav");
As you can see this is a very basic example, but gives you an idea on how sound and music is being handled.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

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