Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Testing audio files for corruption (Read 24609 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Testing audio files for corruption

Today I was finally able to recover all my music files from a hard drive that, to put it simply, had become unreadable. I used GetDataBack for NTFS, and as far as I can tell, 100% of my data has been restored. However, I am still paranoid about some of my files becoming corrupted or damaged somewhere during the process and am hoping that someone can put me at rest. I'm looking for a quick way to tell if any of my files were damaged or corrupted during the recovery process so that I can replace them now before I potentially discover problems later on.  I guess I could just play them all, but that would take far too much time... any suggestions, or am I just being paranoid?

Testing audio files for corruption

Reply #1
what kind of audio files?

Some of them contain CRC checksums you could verify with, but we need to know which formats, first.

Testing audio files for corruption

Reply #2
Sorry, I should've clarified... It's my entire collection of music, so it contains Lame MP3s, Nero AAC LC, WavPack and FLAC... the only ones I'm really concerned about are the lossless files, as those will take much more effort to replace.

Testing audio files for corruption

Reply #3
my harddisk crashed last week and that was one of the darkest days ever 
the only good thing is, that i can verify my lossless files. but more than 75% of
my collection are mp3s and these are randomly corrupted...
the lossless codecs you use all have a verify command...use that

Testing audio files for corruption

Reply #4
my harddisk crashed last week and that was one of the darkest days ever 
the only good thing is, that i can verify my lossless files. but more than 75% of
my collection are mp3s and these are randomly corrupted...
the lossless codecs you use all have a verify command...use that


Yeah it's a huge pain isn't it.... I couldn't be too mad about mine because I sort of caused mine to fail.  I'll try to verify my lossless files when I get home today, thanks. I guess you just have to play the MP3s before you know if they are corrupted?

Testing audio files for corruption

Reply #5
I have batch files to verify both WavPack and FLAC files (well, I just created the FLAC one for you  ).

http://synthetic-soul.co.uk/files/wv-verify.bat
http://synthetic-soul.co.uk/files/flac-verify.bat

Save the files to your desktop and drop the folder that contains all your files onto the icon.  It will verify the files using the native verification switches (WVUNPACK -vm file.wv and FLAC -t file.wv) and report any files that fail at the end.

Oh yeah, you may also need to amend the path to the executables near the top of each file, unless they are in the same folder as the batch files or in your PATH. If flac.exe/wvunpack.exe is in the same folder as the batch file (or visa-versa) you can use (for ease, or portability):

Code: [Select]
SET pathToFlac="%~dp0flac.exe"
Code: [Select]
SET pathToWvUnpack="%~dp0wvunpack.exe"
The benefit of the batch files is that they store the paths of the files that fail and then report them at the end.  If you just ran a command at the command line you would lose the output after a few files.

FYI, here's the output from the quick test I ran:

Code: [Select]
Checking: "C:\Documents and Settings\npopham\Desktop\flac-verify"

Verifying: "C:\Documents and Settings\npopham\Desktop\flac-verify\test.flac"
________________________________________________________________________

flac 1.1.2, Copyright © 2000,2001,2002,2003,2004,2005  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

test.flac: ok


Verifying: "C:\Documents and Settings\npopham\Desktop\flac-verify\test2.flac"
________________________________________________________________________

flac 1.1.2, Copyright © 2000,2001,2002,2003,2004,2005  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

test2.flac: ok


Verifying: "C:\Documents and Settings\npopham\Desktop\flac-verify\test3.flac"
________________________________________________________________________

flac 1.1.2, Copyright © 2000,2001,2002,2003,2004,2005  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

test3.flac: *** Got error code 0:FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
test3.flac: *** Got error code 2:FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MIS
MATCH


test3.flac: ERROR while decoding data
            state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC
File failed verification [ERR#1]...


Verifying: "C:\Documents and Settings\npopham\Desktop\flac-verify\test4.flac"
________________________________________________________________________

flac 1.1.2, Copyright © 2000,2001,2002,2003,2004,2005  Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY.  This is free software, and you are
welcome to redistribute it under certain conditions.  Type `flac' for details.

test4.flac: ok


4 file(s) verified.
1 file(s) returned an error.

Files that failed verification:

  "C:\Documents and Settings\npopham\Desktop\flac-verify\test3.flac"


Press any key to exit
I'm on a horse.

Testing audio files for corruption

Reply #6
I guess you just have to play the MP3s before you know if they are corrupted?


that's the only way i think. the mp3-crc16 don't tell you much about
possible corruption...unless you are sure they all had a correct one before
your harddisk crashed...


Testing audio files for corruption

Reply #8
Wow! Synthetic Soul, those batch files are infinitely useful... only 1 corrupt WavPack so far after checking about 75% of my albums. After reading that thread about mp3val, I think I'm going to try that once I re-rip my corrupted album(s). Thanks to everyone for the help.

edit: word choice

Testing audio files for corruption

Reply #9
I have batch files to verify both WavPack and FLAC files (well, I just created the FLAC one for you  ).

http://synthetic-soul.co.uk/files/wv-verify.bat
http://synthetic-soul.co.uk/files/flac-verify.bat


...


Thanks for the batch file! This will be really helpful. I made two changes that you might be interested in:

1) I added the -s flag to flac.exe to reduce the amount of output.

2) The test for folder/file was failing on my system in some cases. The length of the folder was coming up as 4096, not 0. So I changed the test from:

Code: [Select]
IF %~z1 EQU 0 (CALL :FolderAction %1) ELSE (CALL :FileAction %1)


To:

Code: [Select]
IF /i "%~x1" NEQ ".flac" (CALL :FolderAction %1) ELSE (CALL :FileAction %1)


That is, I explicitly check to see if the extension is .flac (case insensitive). I'm presuming you don't have a folder named something like:  Music.Flac

Hope this helps,

Mike

Testing audio files for corruption

Reply #10
I guess I could just play them all, but that would take far too much time.

If you just want to verify that all of the files are readable, here's a simple method from an article I wrote for PC Magazine years ago. This was meant to verify that a burned CD-R is valid, but it works just as well for all the files in a folder on a hard drive:

Use Windows search to search the CD-R. Not for file names as usual, but for files containing a text string. Search for something you know is not there, such as "Matthew Perry ate my underwear." This forces Search to read every byte in every file as it tries in vain to find that string of text.

--Ethan
I believe in Truth, Justice, and the Scientific Method


Testing audio files for corruption

Reply #12
for other formats, you can always use foobar2000 with foo_verifier. it does have this disclaimer though:

Quote
Checks specified media files for decoding errors. Note that with most formats, its accuracy is limited to detecting errors that abort the decoding process.


edit: oops, just the 4 minutes too late.

Testing audio files for corruption

Reply #13
foo_verifier also - at least last time I needed this - fails to detect errors that are so grave that it does not recognize the file. That is, if you have a majorly corrupted song.mp3 in a folder, dump the folder into fb2k, ask it to verify - then it could return OK just because it does not even start verifying it.

Testing audio files for corruption

Reply #14
Thanks for the batch file! This will be really helpful. I made two changes that you might be interested in:

You're probably better of using the FLAC tester which is bundled with the FLAC for Windows installer.

I guess I could just play them all, but that would take far too much time.

If you just want to verify that all of the files are readable, here's a simple method from an article I wrote for PC Magazine years ago.

You've noticed this post is nearly 7 years old, right?
Music: sounds arranged such that they construct feelings.

Testing audio files for corruption

Reply #15
foo_verifier also - at least last time I needed this - fails to detect errors that are so grave that it does not recognize the file. That is, if you have a majorly corrupted song.mp3 in a folder, dump the folder into fb2k, ask it to verify - then it could return OK just because it does not even start verifying it.
That shouldn't be happening, if the file fails to decode then the internal checksum will not match the one decoded by foobar, which will be printed out as an error. I don't see how a file that fails to decode can still retain a valid checksum.

Testing audio files for corruption

Reply #16
foo_verifier also - at least last time I needed this - fails to detect errors that are so grave that it does not recognize the file. That is, if you have a majorly corrupted song.mp3 in a folder, dump the folder into fb2k, ask it to verify - then it could return OK just because it does not even start verifying it.
That shouldn't be happening, if the file fails to decode then the internal checksum will not match the one decoded by foobar, which will be printed out as an error. I don't see how a file that fails to decode can still retain a valid checksum.


You are right about the fact, but you missed the issue. Which is:

- Try to rename a .txt file into .mp3 and dump it into the playlist. Then fb2k will simply pretend it does not exist.
- Try a sufficiently corrupted mp3 file. Still fb2k will pretend it does not exist.

In neither of the cases, fb2k will actually warn you that you have fed it something you call an mp3 (by suffix) but which is not recognizable as such.  For that, use e.g. Windows Explorer search to find all *.mp3, get the count, dump them to fb2k, count ... and if you are missing one in ten thousand, then good luck hunting.

Testing audio files for corruption

Reply #17
You've noticed this post is nearly 7 years old, right?

LOL, totally missed that.
I believe in Truth, Justice, and the Scientific Method

Testing audio files for corruption

Reply #18
- Try to rename a .txt file into .mp3 and dump it into the playlist. Then fb2k will simply pretend it does not exist.
- Try a sufficiently corrupted mp3 file. Still fb2k will pretend it does not exist.

In neither of the cases, fb2k will actually warn you that you have fed it something you call an mp3 (by suffix) but which is not recognizable as such.  For that, use e.g. Windows Explorer search to find all *.mp3, get the count, dump them to fb2k, count ... and if you are missing one in ten thousand, then good luck hunting.
Hmm I see what you mean now. But this kind of makes the verifier useless, doesn't it? Though probably foobar only skips the file if it cannot detect a valid header...