# \[F\] %\_md5audio% changed when writing tags

**URL:** https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [June 22, 2006, 12:51am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480 "2006-06-22T00:51:49Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [June 22, 2006, 12:51am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/1 "2006-06-22T00:51:49Z")

</div>

I just wrote many thousand sof audio files using the technique described here:

[/t/2785/1](https://community.mp3tag.de/t/2785/1)

The idea was simply disable unicode, then press CTRL+A then CTRL+S and all tags are rewritten without unicode.

Because I'm working with a whole library of music as a security I exported all tags before hand, including the %\_md5audio% calculation, and again afterwards.

The idea being that the audio data should be unaffected and hence the %\_md5audio% unchanged. Alas for a good many files the %\_md5audio% value did change!

There are more songs affected than I can easily compare by listeningv, but a spot check reveals no audible change to the file.

Why is it that writing tags affects the MD5 hash of the audio part. I am forced to suspect that either:

1. MP3 tag is altering the audio unintentionally!  
OR
2. MP3 tag is calculating the MD5 hash on the audio part incorrectly.

Logic would suggest that if only the tags are altered and not the audio part, that the MD5 hash of the audio should be unchanged and this is the main aim of looking at that hash!

Is there a bug here? Or is it an interpretation problem?

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [June 25, 2006, 11:50am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/2 "2006-06-25T11:50:31Z")

</div>

Sorry, I can't reproduce this here.

Best regards,  
Florian

---

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [July 1, 2006, 7:52am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/3 "2006-07-01T07:52:50Z")

</div>

> [@Florian](#):
>
> Sorry, I can't reproduce this here.

That's a shame, as it's most disconcerting. I suspect it's a bug in the MD5 audio hash calc not corruption of the actual audio data as spot samples play fine.

Not sure how Ic an help tor eproduce it, except perhaps to send you one of the files affect in its before and after state. WOuld that help? if so I'll try and dig one up (I believe I can, but am not 100% sure) - I'll only go to the effort if it's useful to you Florian).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 2, 2006, 2:33pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/4 "2006-07-02T14:33:54Z")

</div>

Yeah, maybe a set of affected files would reveal the issue.

---

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [July 2, 2006, 7:55pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/5 "2006-07-02T19:55:58Z")

</div>

O.K. I have two. A MP3 and WMA both displaying the symptom, just selected from a many dozens perhaps hundreds affected. I reproduced the effect reliably. It's a zip of about 5 mMB with 4 audio files and one exported .csv file to illustrate.

The two AFTER files are greted by MP3tag 2.36a by ensuring is in all field sof the Tag Panel (CTRL+Q) then exporting tags (CTRL+E). The selected tags should be obvious but the key one is the last column which is "%\_md5audio%".

The only other difference bweteen the versions BEFORE and AFTER is that unicode was disabled in MP3tag between (i.e. AFTER is tagretted to be unicode free version opf BEFORE).

I hope this helps.

(ADDENDUM: Attachment failed, will upload as soon as I can or if FLorian suggest a better way to ge 5MB to him).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 3, 2006, 3:31am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/6 "2006-07-03T03:31:01Z")

</div>

> [@Bernd Wechner](#):
>
> (ADDENDUM: Attachment failed, will upload as soon as I can or if FLorian suggest a better way to ge 5MB to him).

[Email](http://mp3tag.de/contact.html) or one of the free services to send files.

---

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [July 3, 2006, 8:16am UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/7 "2006-07-03T08:16:35Z")

</div>

> [@Florian](#):
>
> [Email](http://mp3tag.de/contact.html) or one of the free services to send files.

Done! Let me know what you find Florian. I'm curious.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 3, 2006, 5:02pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/8 "2006-07-03T17:02:54Z")

</div>

For MP3 files, the bug was due to an ID3v2 tag which caused an internal exception. Therefore the ID3v2 tags wasn't read completely and wasn't ignored at calculating the MD5 hash.

Computing the MD5 hash for the audio part is only available for files with "trivial" tag formats (e.g. ID3v1, ID3v2 and APEv2). WMA, Vorbis, FLAC and MP4 have tagging formats specified and integrated with the file format which makes it difficult to compute the MD5 hash for the audio part.

That's why the %\_md5audio% placeholder is limited to MP3, MPC, APE, TTA and WV. I'll add this information to the help file.

Thanks for reporting!

Best regards,  
Florian

---

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [July 3, 2006, 9:43pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/9 "2006-07-03T21:43:54Z")

</div>

> [@Florian](#):
>
> For MP3 files, the bug was due to an ID3v2 tag which caused an internal exception. Therefore the ID3v2 tags wasn't read completely and wasn't ignored at calculating the MD5 hash.
> 
> Computing the MD5 hash for the audio part is only available for files with "trivial" tag formats (e.g. ID3v1, ID3v2 and APEv2). WMA, Vorbis, FLAC and MP4 have tagging formats specified and integrated with the file format which makes it difficult to compute the MD5 hash for the audio part.
> 
> That's why the %\_md5audio% placeholder is limited to MP3, MPC, APE, TTA and WV. I'll add this information to the help file.
> 
> Thanks for reporting!

Thank you for the diagnosis! As I suspected it's a bug in hoe the Audio  
hash was calculated and not a major concern.

I noticed however by the by in those exports just before I sent them to you, that the WMA example seems to have been resampled as well (different bitrate reported). Given it was purely a CTRL-S with in all tags for a unicode strip that caught my eye. I hadn't noticed it before, and the sample rate changed from 32000 to 44100.

Is there some surreptiitous audio resampling going on? Or a fault in the WMA tag read/write process?

Also, I'm curious about how the ID3v2 tag caused an exception? Was it a bad tag at my end? Or just an aceptable tag not handled well by MP3tag? If the latter, might this have affected other files (I did this one a LOT of files and they sit there with a backup on another drive, waiting for me to say "yay, I'm happy that the unicode strip is O.K. and didn't trash some of my music ;-).

I guess it would be nice if MP3tag caught such exceptions and reported them in the GUI somehow.

Thanks again for the diagnosis!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 4, 2006, 3:16pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/10 "2006-07-04T15:16:05Z")

</div>

> [@Bernd Wechner](#):
>
> I noticed however by the by in those exports just before I sent them to you, that the WMA example seems to have been resampled as well (different bitrate reported). Given it was purely a CTRL-S with in all tags for a unicode strip that caught my eye. I hadn't noticed it before, and the sample rate changed from 32000 to 44100.
> 
> Is there some surreptiitous audio resampling going on? Or a fault in the WMA tag read/write process?

Again, I can't reproduce this (even with the two sample files you've sent me).

> [@](#):
>
> Also, I'm curious about how the ID3v2 tag caused an exception? Was it a bad tag at my end? Or just an aceptable tag not handled well by MP3tag?

It was due to an empty USLT frame. I've changed the code to be more tolerant at this point.

Best regards,  
Florian

---

<div class="post-metadata">

### Author: ![bwechner](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/839c29/32.png) [@bwechner](https://community.mp3tag.de/u/bwechner)
#### Post date: [July 4, 2006, 9:14pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/11 "2006-07-04T21:14:19Z")

</div>

> [@Florian](#):
>
> Again, I can't reproduce this (even with the two sample files you've sent me).

That's interestig. I'll try again when I'm back home (time zones mean you're catchig me at work). Would be odd to imagine it's machine specific, more likley an operational (user) error at eithe rmy end or yours in producing the result ;-). But who knows? I'll try and reproduce and let you know, and perhaps find another file exhibitig same (I have many ;-).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 1:55pm UTC](https://community.mp3tag.de/t/f-md5audio-changed-when-writing-tags/3480/12 "2018-12-28T13:55:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
