<div dir="ltr"><div>Hi Federico,</div><div><br></div><div>It seems reasonable to assume you've converted the file with Audacity the first time around. Audacity doesn't store foreign metadata, it converts part of it and ignores the rest. More specifically, it reads the tags from the WAV file and stores it as Vorbis comments in the FLAC file. There is no way FLAC can restore the original metadata, because part of it is lost.</div><div><br></div><div>The flac command line tool, when used with the keep foreign metadata option, does not do any translation, it stores and restores the metadata.</div><div><br></div><div>Considering the error message of 1.4.3, that should be improved yes.</div><div><br></div><div>Kind regards, Martijn van Beurden<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op wo 18 okt 2023 om 00:12 schreef Federico Miyara <<a href="mailto:fmiyara@fceia.unr.edu.ar">fmiyara@fceia.unr.edu.ar</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<br>
Dear All,<br>
<br>
I've sent yesterday this issue, but as it contained two screenshots,
I'm not sure if it reached the list. I post it again with some
updates. <br>
<br>
1) I had encoded a WAV file three years ago. Examining the FLAC file
with an HEX/text viewer, i find at the beginning, after some
headers, it declares <br>
reference libFLAC 1.3.1 20141125. However, I'm pretty sure I didn't
use that version since I hadn't it. Besides, now I encoded again the
original file with 1.3.1, 1.3.2, 1,3.3 and 1.4.3 and none of them
shows in a human-readable way the version of the codec, so I presume
I encoded it directly from Audacity, which probably adds such
information. <br>
<br>
2) The original WAV file (which I hadn't deleted) contained metadata
(title, artist, that sort of thing), and the FLAC file, along with
the version, shows human-readable metadata. Maybe Audacity adds this
info when exporting?<br>
<br>
3) Now I try to decode it using libFLAC 1.4.3 with the "keep foreign
metadata" option enabled and I get the following error (Spanish
locale):<br>
<br>
<blockquote>L:\Mis documentos\Electrónica\DyCE IV\_Clases
on-line\FLAC\DyCE4_Clase_14_(03_11_2020).flac: ERROR reading
foreign metadata: invalid WAVE file: missing "fmt " chunk (024)<br>
Presione una tecla para continuar . . . <br>
</blockquote>
<br>
This is weird since the original file <u>was</u> a WAVE file, but
if it hadn't been the case, the error should have shown when trying
to encode, which didn't happen. Besides, the "fmt " chunk has
nothing to do with any foreign metadata, and moreover, I don't think
a "fmt " chunk is expected to be found by the decoder in a FLAC
file. Rather, it should be recreated by the decoder when yielding
the wave file.<br>
<br>
4) Now, if I remove the "keep foreign metadata" option from the
decoding settings, the decoding is successful but the audio content
is not verbatim (even if the waveforms seem to be identical and
sound the same as well). A possible explanation is that Audacity
exports differently to WAV and to FLAC<br>
<br>
5) Next I tried to decode the same file using both libFLAC 1.3.1 and
libFLAC 1.3.3, again with the "keep foreign metadata" option
enabled. The result is this error: <br>
<br>
<blockquote>DyCE4_Clase_14_(03_11_2020).flac: ERROR reading foreign
metadata: no foreign metadata found (022)<br>
Presione una tecla para continuar . . .<br>
</blockquote>
<br>
This message makes a bit more sense since it doesn't make any
implication about the WAV file. However, it insists there are no
foreign metadata, but when one examines the file with an HEX/text
viewer, the metadata are present and are human-readable. Maybe there
is metadata but not in a format the reference codec recognizes?<br>
<br>
6) Decoding with libFLAC 1.3.3 without "keep foreign metadata"
yields the same result as with 1.4.3 <br>
<br>
7) Encoding again the original WAV using 1.4.3 yields a FLAC file
which once decoded yields an identical copy of the original WAV
file. It is slightly smaller than the 1.3.1 FLAC, and viewing it in
HEX doesn't show any recognizable version of the metadata, in
contrast to the 1.3.1. I guess now the info is zipped or so.<br>
<br>
Finally, with all the other files I had no problem.<br>
<br>
I don't think this is relevant, but just in case, the original
encoding was made on Windows 7 and now I'm working on Windows 10.<br>
<br>
Regards,<br>
<br>
Federico Miyara <br>
<br>
<br>
Images included in the first post (not sure whether they reach the
list, I can post them individually at request):<br>
Beginning of the file viewed as HEX<br>
Comparison of both files. Right: original WAV file, Left: Decoded
WAV file from 1.3.1 FLAC file <br>
<br>
<br>
<br>
<br>
<br>
<div id="m_-5172241099702388132DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br><table style="border-top:1px solid rgb(211,212,222)"><tbody><tr><td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td><td style="width:470px;padding-top:12px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Libre de virus.<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a></td></tr></tbody></table><a href="#m_-5172241099702388132_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></div>
_______________________________________________<br>
flac-dev mailing list<br>
<a href="mailto:flac-dev@xiph.org" target="_blank">flac-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/flac-dev" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/listinfo/flac-dev</a><br>
</blockquote></div>