sr-convert
is a sample-rate conversion utility for WAV files. Its primary emphasis is on sound
quality. It supports a wide variety of sampling rates and can convert from any of the supported rates to any other. It
uses SSE instructions if they are available on your system.
It is licensed under the GNU General Public License.
Read the instruction manual
here, and download it
here.
sr-convert
is most often used to convert between 44.1 kHz and 48 kHz. For example, if you record your
own music at 48 kHz, you can downconvert it to 44.1 kHz for burning to CD. Or, if you rip CDs, you can upconvert them
to 48 kHz before you ogg-encode them, which results in slightly better sound
quality.
“It does?!” If you’re familiar with DSP theory, you know that upsampling doesn’t actually introduce any new frequencies into the signal. So why upsample? Answer: because sometimes the filter in sr-convert is better than the one in your DAC and your sound drivers.
Just try it. You’ll like it!
(Sun, Sept 25, 2005.) Updated link to new (unsupported) WAV file formats in documentation again.
(Wed, Apr 6, 2005.) Removed irrelevantia from this news page.
(Thu, Feb 18, 2005.) Finally! A new release! It’s a small one, source only, but it can compile with GCC 3.4 and it adds support for 8-bit output, a new sampling rate, and error-correction dithering.
(Wed, Apr 21, 2004.) Yes, I still haven’t had time to work on sr-convert. I am still answering e-mail about it, though.
I have discovered a faster way to upsample provided you are going 2:1, 3:1, or something of that nature, using FFTs. I was prompted to this discovery by a user e-mail. (Thanks, Lawrence!) I would like to implement that. It would even help with 44.1 -> 96 because you could go 44.1 -> 48, which takes half the work in convolution, then use FFTs to do the 48 -> 96.
I also have ideas about distributed sample-rate conversion. A file would be divided up into pieces which could be converted separately and then reassembled. This would require threads and sockets, which are different under Windows and Linux. I know more about how to deal with them in Windows than in Linux.
I bought a book about CVS for the specific purpose of checking this project into CVS. However, I don’t know whether to maintain separate Windows and Linux versions, or try to make both targets build from the same codebase. (Currently they build from the same codebase.)
(Mon, Nov 17, 2003.) I apologize that I still haven’t released a new version of this program. I’ve been working on another project. At some point I will pause on it and work on sr-convert again and get some new features in.
Some features that users have requested include [a] pipe mode, which would allow the program to read samples from standard in and/or write samples to standard out, [b] batch mode, wherein the program can open multiple files and convert them all, and [c] an interface that would allow sr-convert to be controlled by another process.
As to batch mode, I’ve been writing Windows batch files like this:
mkdir out for %1 in (*.wav) do sr-convert %1 - out\%1 48000
In bash
you can do something similar:
mkdir out; for BLAH in *.wav ; do sr-convert $BLAH - out/$BLAH 48000 ; done
(Thu, Jun 13, 2003.) A minor change to the online documentation.
An Updated Link. Microsoft has moved their page on the new WAV file formats (the ones this program doesn’t support yet). So I have updated the link in the online documentation.
The Need for Scheme. The documentation states that a Scheme interpreter is necessary in order to build the program. Technically, it is possible to get by without one: Scheme is only used to build one file, and the file is included in the distribution. However, it is necessary to read far into the documentation to find this out, and many people just skim it. If you don’t modify the Scheme source, then you can use the existing file without needing to run Scheme again. If you never run it, you don’t need it installed. Just a clarification. (Also, you don’t need a compiler or Scheme to run the program.)
I apologize for not coming out with another version or doing something to boost the project’s activity level. I’ve just been too busy. I’ll be back.
(Sat, Feb 22, 2003.) Version 0.8 has been released. It should be considered a beta: even though it seems to run
quite stably on
my system, no one else has tested it, so your feedback is
greatly appreciated. You can help make sr-convert
a better program! (And if you like it just the way it
is, you can say that, too.)
You can download it here. There are two
files. The .zip
file is the Windows version which includes both source code and a binary. The
.tar.gz
file is the Linux version which also includes both source code and a binary.
Here are some notices that came to light after the files “went to press,” so to speak.
The table of contents for the instruction manual incorrectly claims that the section on Licensing is “not yet written.” The section has since been written — but I forgot to delete that note from the table of contents after I wrote the section. Doh! This has been corrected in the on-web version but not in the version in the files.
GCC 3.2 doesn’t compile the source code correctly, becuase the source code still uses some C++ features which became obsolete with the release of the later versions of GCC. The older GCC 2.95 compilers work correctly. This means also that MinGW version 1 will work but the newer version 2 will not. This will be corrected in a future release.
The manual incorrectly states that the Makefile generates an executable called sr-convert.exe
in
Linux. This minor bug has been corrected. The executable in Linux is now called sr-convert
, without the
.exe
extension, as it should be.
Enjoy the program!