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 Flac Collection (Read 3037 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Testing Flac Collection

Hello,

I posted a question here (post #17) but the thread lost it's momentum and i was unable to find a adequate answer after searching the past forum posts.

Quote
What else will the "-t" command find? I'm guessing file coruption is in there (disk error, etc...). What about if a flac file had a error while encoding? I ask cause i used EAC a lot before the "Check for external programs return code" option was available. If an error did occur during encoding, and since at the time EAC couldn't tell you, would the resulting flac file show a error upon "-t" inspection now?


So i understand that the "-t" command will return errors on files if they are corrupted after they are encoded (disk error, file corruption, etc...).  However, what if the file was encoding and a error occured?  I have only one .flac file that i know had a error on encode (I canceled the "flac.exe" process a bit after EAC riped and started the external encoder to encode the track) so i know that the "-t" command will pick up this.  Will "-t" pick up other encode errors?

I ask because i see that EAC added the "Check for external programs return code" in the most recent build and i would like to check my existing collection that was ripped when EAC did not have this option.

Thanks!

Testing Flac Collection

Reply #1
"flac -t" tests that 1) the stream is a legal FLAC stream; 2) that the decoded data matches the data that was originally fed to the encoder.

so if a valid FLAC file is corrupted in any way after encoding, it will catch it.

if there was an error during encoding, which left a partial FLAC file, "flac -t" should still catch it unless the partial FLAC file ended exactly on a frame boundary.

even if that happens, if it was encoding a wave file, and not through pipes, there will be other clues in the metadata that will tell you the encoding didn't complete, like total_samples and md5_signature in the STREAMINFO block will be 0.

Josh

Testing Flac Collection

Reply #2
Thanks for your response.

I made my flac files like this (EAC-->WAV-->FLAC(through EAC command line), i would then use fb2k to add replaygain and then touch up tags if need be) is this not considered "in the pipe"?  I'm a little out of date on that term...  (pipe = bitstream encoding?)

I tried to modify the code i read in a previous post in order to store the total_samples and md5_signature in a output file.

Code: [Select]
for /F "tokens=*" %I in ('dir /s /b *.flac') do metaflac.exe --with-filename "%I" --list --block-number=0 2>> error.txt


However, this returns a blank txt file, i've tried other variations with little success, and i think that even if it did work it would probably output all of the information in the STREAMINFO block, which would be alot to dig through.  Is there a command to only focus on the total_samples and md5_signature portion just display them or to see if they are 0?

Or am I perhaps bending over backwards and should instead utilize a program to do this?  Any suggestions on how to check these values would be greatly appreciated.

Thanks for your help!

Edit: Ok, i was able to come up with this

Code: [Select]
for /F "tokens=*" %I in ('dir /s /b *.flac') do metaflac.exe --with-filename "%I" --show-md5sum --show-total-samples 2>> error.txt


Now that narrowed the output to the sum and the total samples only, but the output file still won't list anything...

Edit2: Bingo!

Code: [Select]
for /F "tokens=*" %I in ('dir /s /b *.flac') do metaflac.exe --with-filename "%I" --show-md5sum --show-total-samples >> error.txt


This outputs a file with the filename listed twice with the md5 checksum first and then the total samples next.

So, if any of these values return "0", that means they failed during encoding, correct?

Thanks!

Testing Flac Collection

Reply #3
if they are 0 and you encoded via EAC through the command-line, then yes there probably was an error.

pipes are when you link the file descriptors of two processes together.  in most shell languages it looks like:

Code: [Select]
cat file.wav | flac - -o file.flac


that '|' sign creates a pipe.  in some piping cases, flac can not tell that the thing feeding it data had an error so it will create a FLAC file that looks fine but only contains the data it got before the error.

Josh

Testing Flac Collection

Reply #4
Thanks for the pipe clarification.

None of my files reported any 0's. 

Thanks for your help!