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.
// 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);