[Flac-dev] Compressing sound fonts with FLAC

Josh Green jgreen at users.sourceforge.net
Tue Feb 13 16:47:11 PST 2001


I've been doing some more tests with compressing sound fonts with FLAC.
It compares quite well with sfArk which is a common compression used on
the internet for sound fonts, unfortunately its not open. For the most
part, in my tests, sfArk beats FLAC in compression, but thats not
surprising as I am compressing entire sound fonts which include
non-audio data as well. The average compression ratio for 8 fonts of
various sizes:

sflac: 0.592
sfArk: 0.536

FLAC seems to be slightly faster (although I am running sfArk through
wine), total time for 8 files:

sflac: 12.81 seconds
sfArk: 13.7 seconds


I stripped out all non-audio data from a few fonts (which doesn't
usually amount to much, 50k in a font with a lot of
preset/instrument/sample overhead information). I managed to save a good
20k by gzipping this data and not making FLAC compress it. Not that much
for all the effort. Although I noticed that FLAC didn't do very well
with the non-audio data (I didn't expect it to), so I do like the idea
of separating this data and gzip/bzip'ing it.

I think I can save more data by concentrating on the audio.
The sample chunk in a sound font is composed of many samples, all 16 bit
word aligned. Each sample can have its own sampling rate. These samples
appear one after the other, each with 46 '0' pad samples at the end. I
can see that this might not be optimal for FLAC.
Any ideas of how to get FLAC to better compress these back to back
samples? I'm probably going to be writing a utility that uses the
library interface to FLAC. Lates..
	Josh Green




More information about the Flac-dev mailing list