SoundAS is a modern lightweight Sound Manager. It was created to simplifying playback of audio files, with a focus on easily transitioning from one to another, and differentiating between SoundFX and Music Loops. It provides a strongly typed, performant SoundManager, with a clean and focused API.
Among other features, the library has a clean API, easy memory management, chaining as SoundAS.play("music").fadeTo(0)
and a built-in tweening system (with no dependancies). It’s also possible to manage the loading process of audio files.
Sample
// Loading //Load sound from an external file SoundAS.loadSound("assets/Click.mp3", "click"); //Inject an already loaded Sound instance SoundAS.addSound(clickSound, "click"); //Play sound. //allowMultiple: Allow multiple overlapping sound instances. //allowInterrupt: If this sound is currently playing, start it over. SoundAS.play("click", volume, startTime, loops, allowMultiple, allowInterrupt); //Shortcut for typical game fx (no looping, allows for multiple instances) SoundAS.playFx("click"); //Shortcut for typical game music (loops forever, no multiple instances) SoundAS.playLoop("click"); //Toggle Mute SoundAS.mute = !SoundAS.mute; //Fade Out SoundAS.getSound("click").fadeTo(0); //Mute one sound SoundsAS.getSound("click").mute = true; //Fade from .3 to .7 over 3 seconds SoundAS.getSound("click").fadeFrom(.3, .7, 3000); //Manage a SoundInstance directly var sound:SoundInstance = SoundAS.getSound("click"); sound.play(volume); sound.position = 500; //Set position of sound in milliseconds sound.volume = .5; sound.fadeTo(0);
@as3gamegears does it address mp3 loops eternal-problem?
Thanks for the heads up Alesys, it didn’t contain it, but it does now! Pausing a Looping is sound is just totally broken, so we handle it all looping manually using the SOUND_COMPLETE event which seems to work well.
That’s great, Shawn! Thanks for the reply!
That’s pretty cool Shawn. Thnx for answering.
Tle Boonmak liked this on Facebook.
I do not recommend using this library.
Sean I’m sorry, but looking at your demo, I understand that the library can not be good. When the playback of five sounds programmed of the three hundred lines of code – is hell. Running through the demo time off with the exceptions of the signals. Sean why signals? I wish you to learn more good programming practices.
Sean, so no one writes – public static var CLICK: String = “click”;
The use of anonymous functions does not make you cooler, but impairs the readability and code readability.
Good luck.