I've written a program called "ripcheck" which runs a variety of tests on a WAV file, to see if there are potential mistakes that occurred in converting a CD to a WAV file.
I've made this program available as free & open source, and it can be download at Sourceforce at: https://sourceforge.net/projects/ripcheck/ or from Github at https://github.com/panzi/ripcheck
You can use this program on your own WAV files to see if there potential defects in your CD rips.
.
WHAT?
ripcheckc.c - source code
ripcheckc - Mac OS command line binary
ripcheckc.exe - Windows command line binary
ripcheck.tcl - Slower version, already creates zoomed graphics of problem areas
Released under GPL v3 license - http://www.gnu.org/licenses/gpl.html
.
WHY?
This program was written because we'd received some complaints of occasional "pops" at the beginning on some albums at Magnatune. Further research found that most of the albums we released in 2007 had various CD ripping problems.
At that time, we were using the open source windows program CDEX and on many albums from that time this program would introduce a very short "click" sound at the beginning of each WAV file, which would then trickle down to all the file formats we offered at Magnatune. Most people didn't notice it, probably assuming it was an audio streaming glitch, since it was so short.
In order to discover just how bad the problem might be, I wrote a program called "ripcheck", because, to my surprise, no program currently exists to try to determine if there might be CD ripping errors in an audio file.
.
WHAT KINDS OF PROBLEMS?
Besides the common problem short click at the beginning of a track, this program also discovered:
1) the occasional dropped sample (i.e. a sample value of zero) in the middle of a song. This might be audible as a click as well.
2) the occasional repeated sample value, for about 1/1000th of a second. This would be audible as a very short tone.
3) the occasional empty spot in the middle of a song.
All in all, my program found that 124 albums at Magnatune had some sort of defect in them.
Most of the defects could be attributed to our early years, when we were running our ripping on Windows with software that was in its early versions (remember, we've been doing this since 2003, when CD ripping was pretty new).
Occasional problems also crept in from CDs burnt too quickly or on cheap CDR media, that were then sent to us as "masters".
What's amazing to me is that all these albums were sent to Amazon and iTunes, and those services never noticed anything. Obviously, though companies don't have any sort of "ripcheck" program, to do automatic quality control on the audio they distribute.
All our releases are now automatically tested with "ripcheck" before we make them available. And, all 124 albums that had defects in them have been repaired, in most cases with an audio editor. To remove the introductory pops (usually two samples long), I used Fission because it's a quick tool to use and the pops were in the silent part before the song starts. To fill in the occasional zero sample, I used Sequoia a professional grade audio program and actually drew in the missing sample. Where there was more than one sample missing, we reripped the CD master with modern software. If the CD master had defects in it (which as the case for about 20 releases), we contacted the musician and obtained new CD masters, which we insisted be slow (4x speed) burned. ripcheck was then rerun on all new audio to make sure that the defects were in fact removed.
.
HOW TO OBTAIN:
If you'd like to run this program yourself, on your own music library, please download at Sourceforce at:
https://sourceforge.net/projects/ripcheck/
It's a command line program that works on Windows, Mac and Unix/Linux. There is a fast version, which shows potential problems as text, and a much slower version which generates graphics of the WAV file defects, so you can easily see where the problem is.
In all cases, the location of the glitch is given in samples and milliseconds. You can use an audio editing program to type this number directly in and jump to that point.
Here is a typical warning, which detected 545 duplicate samples at two minutes into a song, which will sound like a very short (.012 seconds long) high pitched tone:
The ripcheck.tcl version of the program made this GIF for this WAV file, showing the context of the potential problem, and highlighting in red what it thinks the bad data is:
This particular audio file had two real problems. The repeated sample above is definitely a glitch on the CD (in this case, on the CDR master).
There was also a two sample long pop at the beginning of the recording, which ripcheck detects by looking for samples in the first five seconds of the song that have a zero value (silence), followed by a very short few samples that have a high value, followed by more silence. Here is how the ripcheck.tcl graphic represents this pop at the beginning of the song:
All the errors in a song are displayed as one GIF file, with the same name as the WAV file but with a .gif filename extension. The image zooms in on each error. Here is what the complete GIF file looks like for this song, showing the two problem areas (click on the graphic to see the full size image):
A text file is created for each WAV file, summarizing problems found, which in this case were:
- possible pop found at sample count 1014 (20 millisecs) values: '0, 0, 0, 0, 24932, 26464, 0'
- 1090 duplicate samples found (value: 18614) in the left channel at sample '6,360,822' (144230 milliseconds)
The program is intentionally over broad in detecting problems, and will often yield false positives (about half of the time, in my experience). For example, if you have electronic music which toys with audio glitches, perhaps creating pure tones with the same sample value, you might get a lot of false positives on that kind of music.
My goal was to always detect potential problems and never overlook real problems. On the Magnatune music collection, I personally listened to every audio file that had a warning, and viewed the samples in an audio editor, before marking a warning as a false positive.
The source code is pretty simple to read, and I'd love for any programmers who find it useful to devise other tests and add them to the list of things to detect.
.
HOW TO RUN:
If you download the .exe file for windows, you will also need to install cygwin.
To run it yourself, type:
ripcheckc filename.wav
Only WAV files are handled, and they must be 44k/16bit.
If you want to use this program on Unix/Linux, you will need to compile the program with this command line:
gcc ripcheckc.c -o ripcheckc
The ripcheck.tcl program requires Tcl/Tk to be on your system, and ImageMagick as well. It runs about 3x slower, but creates attractive graphics of the WAV file problem areas. This can be a great time saver if you have a lot of problematic WAV files, aiding you in quickly reviewing the problems visually to decide if they are false positives.
If you want a WAV with defects to test, you can download:
http://magnatune.com/p/ripcheck_example.zip
This file has both a pop at the beginning, and a RIP error in the middle of the song.
- possible pop found at sample count 1012 (22 millisecs) values: '0, 0, 0, 0, 24932, 26464, 0'
- 545 dupes found at sample count 6360820 (144236 millisecs) value='5703'
-john