• 10
• 9
• 12
• 14
• 13
• entries
208
383
• views
65749

# Preferences Editor, and SoundManager

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 TRIGGERSoundManager.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.

There are no comments to display.