flac -t audio.flac<div><br></div><div><span class="Apple-style-span" style="font-family: lucida, verdana, helvetica, arial, sans-serif; font-size: 16px; "><table width="100%" border="1" bgcolor="#EEEED4"><tbody><tr><td nowrap align="right" valign="top" bgcolor="#F4F4CC">
<a name="flac_options_decode"><span class="argument" style="font-family: monospace; ">-d</span>, <span class="argument" style="font-family: monospace; ">--decode</span></a></td><td>Decode (<span class="commandname" style="font-family: monospace; font-weight: bold; ">flac</span> encodes by default). <span class="commandname" style="font-family: monospace; font-weight: bold; ">flac</span> will exit with an exit code of <span class="argument" style="font-family: monospace; ">1</span> (and print a message, even in silent mode) if there were any errors during decoding, including when the MD5 checksum does not match the decoded output. Otherwise the exit code will be <span class="argument" style="font-family: monospace; ">0</span>.</td>
</tr><tr><td nowrap align="right" valign="top" bgcolor="#F4F4CC"><a name="flac_options_test"><span class="argument" style="font-family: monospace; ">-t</span>, <span class="argument" style="font-family: monospace; ">--test</span></a></td>
<td>Test (same as <span class="argument" style="font-family: monospace; ">-d</span> except no decoded file is written). The exit codes are the same as in decode mode.</td></tr></tbody></table></span><br><div class="gmail_quote">
On Sun, Apr 24, 2011 at 5:43 AM, Anton Shepelev <span dir="ltr"><<a href="mailto:anton.txt@gmail.com">anton.txt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
J.B. Nicholson-Owens:<br>
<br>
> I'm not sure what you're asking for<br>
<br>
I have a huge archive of FLAC files and want auto-<br>
matically to check the integrity thereof, so as if<br>
some file be reported as corrupted I can restore it<br>
from a mirror backup.<br>
<br>
> I should have mentioned before that apparently the<br>
> MD5 hash is computed on the uncompressed raw sam-<br>
> ple data and the easiest way to check the FLAC<br>
> file is with<br>
><br>
> flac --verify audio.flac<br>
><br>
<br>
This doesn't work, and the official FLAC focumenta-<br>
tion says this option is only applicable to WAV<br>
files:<br>
<br>
-V, --verify<br>
Verify the encoding process. With this<br>
option, flac will create a parallel<br>
decoder that decodes the output of the<br>
encoder and compares the result against<br>
the original. It will abort immediately<br>
with an error if a mismatch occurs. -V<br>
increases the total encoding time but is<br>
guaranteed to catch any unforseen bug in<br>
the encoding process.<br>
<br>
It seems to have nothing to do with the MD5 hash.<br>
<br>
The procedure you have described in your previous<br>
reply is quite complicated for an automatic check-<br>
ing. Why does FLAC calculate MD5 on the RAW uncom-<br>
pressed data? If it were using compressed data<br>
instead the checking wouldn't require decompression<br>
and would be quicker: just calculate the hash on the<br>
binary file and compare it against the stored<br>
value...<br>
<br>
Anton<br>
_______________________________________________<br>
Flac mailing list<br>
<a href="mailto:Flac@xiph.org">Flac@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/flac" target="_blank">http://lists.xiph.org/mailman/listinfo/flac</a><br>
</blockquote></div><br></div>