Audio Sprite Packer
local processingAudio Sprite Packer
What it is
Loading dozens of tiny sound files makes a web game slow, and some mobile browsers only unlock audio for one file. An audio sprite puts all the effects in one file and describes where each one starts and how long it is. This tool decodes your files, optionally trims the silence at the start and end, levels them, converts them to one sample rate and to mono or stereo, and lays them one after another with a gap so they never bleed into each other. A waveform shows where each sprite starts, every clip can be played, and the result is a 16-bit WAV plus a JSON map in the Howler.js format (start and length in milliseconds) or the Phaser format (start and end in seconds). Mark a clip as looping to write the loop flag.
When to use it
Use it to ship the sound effects of a web or mobile game as one file, to give a Howler or Phaser project a sprite map, or to clean up a folder of sound effects before you compress them.
Gotchas & limits
The output is a WAV file. Convert it to OGG and MP3 with a tool such as ffmpeg (the commands are shown), keep the same file name, and list the formats in your player. Compression adds a little silence at the start and end of a file, so keep a gap of at least 50 to 100 ms between sprites. Looping clips can click if they do not end where they begin, and trimming silence should not be used on clips that need a quiet start. Normalizing makes every clip equally loud at its peak, which is not the same as equal perceived loudness. Decoding depends on what your browser can read. Files are limited to 30 MB each and the result to five minutes.