[Vorbis] Best practice for encoding short sound effects
Damian Yerrick
tepples at spamcop.net
Mon Nov 15 12:08:38 PST 2010
A video game has several short sound effects, many of them 0.1 to 0.5
seconds in length. Which lossy audio codec is most efficient for
encoding waveforms this short?
I'm working on an audio framework to replace SDL_mixer, which I
didn't find as flexible as I'd like. I wrote a RIFF WAVE loader, a
Vorbis file loader, and a streaming Vorbis file player. But when
encoding samples for testing this, I discovered that Vorbis appears
to have a substantial header. I tried encoding a folder of 28
different sound effects, which take 161 KiB as a mixture of 8-bit and
16-bit mono waves at various sample rates from 12000 Hz to 32000 Hz.
Converting all of them to Vorbis using OggDropXPd (libvorbis 1.3.1)
at quality 3 resulted in files totaling 139 KiB. But when I
resampled all of them to 32000 Hz, concatenated them into one file
with about 0.1 second of silence between them, and encoded that with
OggDropXPd, the result was 83 KiB for a total of roughly 11 seconds
of audio.
So Vorbis might not be the best choice for short sounds like these.
Would CELT be any better? I see that it has "low delay"; Or should I
just use, say, a 4-bit ADPCM codec like IMA, BRR, or VAG? Or is
concatenation in this manner the best practice?
--
Damian Yerrick
More information about the Vorbis
mailing list