Jump to content
  • Advertisement

Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    66184

Preferences Editor, and SoundManager

Sign in to follow this  
H_o_p_s

314 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
×

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!