[flac-dev] Strange behaviour --UPDATE--

Federico Miyara fmiyara at fceia.unr.edu.ar
Tue Oct 17 22:12:04 UTC 2023


Dear All,

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.

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
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.

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?

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):

    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)
    Presione una tecla para continuar . . .


This is weird since the original file _was_ 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.

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

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:

    DyCE4_Clase_14_(03_11_2020).flac: ERROR reading foreign metadata: no
    foreign metadata found (022)
    Presione una tecla para continuar . . .


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?

6) Decoding with libFLAC 1.3.3 without "keep foreign metadata" yields 
the same result as with 1.4.3

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.

Finally, with all the other files I had no problem.

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.

Regards,

Federico Miyara


Images included in the first post (not sure whether they reach the list, 
I can post them individually at request):
Beginning of the file viewed as HEX
Comparison of both files. Right: original WAV file, Left: Decoded WAV 
file from 1.3.1 FLAC file






-- 
Este correo electrónico ha sido analizado en busca de virus por el software antivirus de Avast.
www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20231017/2d8ed717/attachment.htm>


More information about the flac-dev mailing list