An AudioSprite implementation for Flash, written in Haxe.
This project relies on content published with the AudioSprite tool found here: tonistiigi/audiosprite
Essentially, AudioSprite is a collection of all your sounds combined into one MP3 / OGG (or other format) that has each clip's name, start-time and end-time catalogued in a JSON file.
There are a few existing HTML5 implementations out there, but none that I could find for Flash.
So here it is!
The project is still early in development and lacks quite a bit of features (and probably misses some details regarding the AudioSprite structure). So here's a list of things I'm planning to implement next:
- SoundTransform: handle volume, pan, left & right channel distribution. Could be passed by channel, sound ID, or entire AudioSprite engine / SoundMixer.
- Events: Setup events that can dispatch like the built-in Sound object does in Flash.
- Optionally Do/Don't Loop: Even though the JSON file dictates which sounds are intended to loop, the developer could override it by passing the # of loops manually:
play(id:String, loop:Int)
- HTML5 Implementation: Although there are existing JS libs that handles AudioSprites (HowlerJS, SoundJS, Zynga-Jukebox), it makes sense to create a JS version to keep the functionality consistent for cross-platform development.
- Fade-Ins & Fade-Outs: Handle smooth audio fade-in/-out, cross-dissolve between sounds.
- Support Playrate (Fast/Slow): Change the speed of a sound (affects pitch & timing) using the
SAMPLE_DATA
event. Could be processed as a static (once-at-start) or dynamic (change-in-realtime) effect.
If you want to help, leave me a note on Twitter @_bigp or here on GitHub!