AboutSoundEncoder is a project I did for Richard E. Crandall's Scientific Computation class at Reed College. It is an example of a simple FFT based sound compressor. The sound file is opened, floats are read out, the FFT is taken, the spectrum is quantified, and finally the quantified data are fed through an entropy encoder (an Elias encoder in this case) and writen to file. Decoding is just the reverse.
I picked an Elias encoder because the histogram of the spectrum is centered around 0 and Elias encoders excel at such data. You can read more about this kind of DSP in Crandall's book.
UsageThanks to libsndfile it should handle most audio file formats as input, but right now it only outputs AIFF. And there is no direct playback of .qec files, but that should be easy enough for someone to add if they want.
The usage is pretty simple:
SoundEncoder <file to encode> will produce an encoded file <file to encode>.qec
SoundEncoder -D <file to decode>.qec will produce an AIFF of <file to decode> with the name <file to decode>
System Requirementslibsndfile 1.0.11 or later (get it here)
The code is not OS specific and should compile on any POSIX compatible OS. The provided binary should run on Mac OS X.
- Version 1.0
- Initial public release.