# MP3 file serial number?

**URL:** https://community.mp3tag.de/t/mp3-file-serial-number/57671
**Category:** Support
**Created:** [June 19, 2022, 2:48pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671 "2022-06-19T14:48:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 19, 2022, 2:48pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/1 "2022-06-19T14:48:15Z")

</div>

Is there a way to give each file a kind of serial number -- a detail that is never changed and passed along when converting bitrates, etc?

Now that I've renamed my entire library, all my playlists are broken. I figure, if there was one unique detail about the file that never changed, I wouldn't have to deal with this in the future.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 19, 2022, 2:57pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/2 "2022-06-19T14:57:52Z")

</div>

> [@Dr\_H\_Vanderbear](#):
>
> a detail that is never changed and passed along when converting bitrates, etc

That would depend a lot on the encoder - whether that respects existing tags.  
In general: all ID3 tags can be changed by some program, so there is no "never".

You can add a user-defined field that you all SERIAL\_NUMBER (or whatever you like) and then fill it with values of your choice.  
Also, have a look at the list of supported fields in the documentation:

> **[Tag Field Mappings Table – Mp3tag Documentation](https://docs.mp3tag.de/mapping-table/)**
>
> Overview of all available tag fields, their names in Mp3tag, and how they are mapped to the internal structures of the different tag formats. Mp3tag is the universal Tag Editor.

some files already come with identifiers or an official one could be added.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 19, 2022, 6:07pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/3 "2022-06-19T18:07:54Z")

</div>

> [@Dr\_H\_Vanderbear](#):
>
> a detail that is never changed and passed along when converting bitrates

AFAIK there is no such unchangeable identificator for your mp3 files.  
Theoretically, you could use some kind of [watermark](https://en.wikipedia.org/wiki/Audio_watermark) for your songs, integrated in the audio part of your songs. But I would not garantuee that such a watermark would survive every format change (let's say from Mp3 to wav to FLAC).

The linked wikipedia article about audio watermarking speaks about "difficult to remove", not "impossible" to remove.  
One of the contra argument I read about: "It can interrupt and inevitably ruin the experience of the end-user listening to your audio file"

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 20, 2022, 6:27am UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/4 "2022-06-20T06:27:52Z")

</div>

Just thought a bit about it:  
If you want to achieve that the link between the playlist and the file is not broken, then also an internal identifier would not help as the playlist relies on filenames.  
The filename is by definition already unique, there can only be one.  
So if you want to keep the filename as a constant you can, of course, use a single field with a serial number or so as source to name the file - but I think this could be the filename already which you could put together from a standardized pattern for the tag fields in use.

What you could also think of: create a field that keeps the name of the playlist and you could then filter or sort that playlist field and reconstruct the playlist from the files. Then it would not matter what the file is called.

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [June 20, 2022, 2:24pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/5 "2022-06-20T14:24:48Z")

</div>

The nuclear option would be to just change all `FILENAME`s to numbers and keep `TITLE`s intact

Benefits: you will never have to truncate very long songs name

Disadvantage: you will always have to use software / hardware capable or in such way that will display `TITLE`s data

---

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 20, 2022, 9:07pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/6 "2022-06-20T21:07:02Z")

</div>

> [@ohrenkino](#):
>
> The filename is by definition already unique, there can only be one.

I arrived to the same conclusion. The filename is as unique as a serial number. I'm using this code to keep as much info in the filename as I can when using Tag - Filename.

**$replace(%albumartist% \_ %album% \_ $num(%track%,2) \_ %year% \_ %title%,:,~,/,+,?,^)**

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 20, 2022, 9:30pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/7 "2022-06-20T21:30:28Z")

</div>

> [@Dr\_H\_Vanderbear](#):
>
> > [@ohrenkino](#):
> >
> > The filename is by definition already unique, there can only be one.
> 
> I arrived to the same conclusion. The filename is as unique as a serial number.

This is only true for a filename inside the same folder. You can have as much of the exactly same filename in as much different folders you want.  
If you talk about an [absolute "filename"](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats) including the drive letter, the root folder name, the subfolder name and the filename itself, then your conclusion is true.

Example for the filename  
`ABBA_Waterloo_02_1974_Sitting in the Palmtree.mp3`  
which can be saved in  
`C:\Music\ABBA`  
and  
`C:\MyOtherMusic\ABBA`  
and  
`D:\MusicBackup\ABBA`  
and  
`D:\MyOtherMusicBackup\ABBA`  
and so on...

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 21, 2022, 6:02am UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/8 "2022-06-21T06:02:05Z")

</div>

I think that if you put these 3 files into a playlist, then I think the path would be added.  
So you will get at least a partially qualiified filename or a fully qualified filename, where the partial is a relative one, and the full is the absolute filename.

The problem stays that as soon as you rename the file, the link between playlist and file is broken.  
So, if you cannot guarantee that the filename stays the same, then it might be an idea to create a user-defined field that stores the playlist name.  
And by filtering and sorting that field you could reconstruct the playlist.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 21, 2022, 6:12am UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/9 "2022-06-21T06:12:53Z")

</div>

> [@ohrenkino](#):
>
> I think that if you put these 3 files into a playlist, then I think the path would be added.

The path can be added in a playlist text file, but that is not mandatory. If you place the M3U playlist in the same subfolder as the files itself, you can ommit the path, like in this [example](https://en.wikipedia.org/wiki/M3U#Examples):

 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/d1d0f16d566eccea005dc5efec7190bebd00f919.png)

> [@ohrenkino](#):
>
> So, if you cannot guarantee that the filename stays the same, then it might be an idea to create a user-defined field that stores the playlist name.

Unfortunately, if you can not guarantee that the filename stays the same, you can also not guarantee that a user-defined ID3 tag would never be wiped or changed.

---

<div class="post-metadata">

### Author: ![Andre\_H](https://community.mp3tag.de/user_avatar/community.mp3tag.de/andre_h/32/11748_2.png) [@Andre\_H](https://community.mp3tag.de/u/Andre_H)
#### Post date: [June 21, 2022, 6:16am UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/10 "2022-06-21T06:16:12Z")

</div>

> [@Dr\_H\_Vanderbear](#):
>
> Now that I've renamed my entire library, all my playlists are broken.

possible approach from the opposite direction: Make yourself independent of fixed, filename-based playlists towards automatically filling, criteria-based playlists. There are plenty of programs for this, I recommend MediaMonkey, for example.

There's nothing quite like adding a few albums to the collection, and having playlists like "Best of 80s/Pop", "Newly Added Songs", etc. automatically updated immediately afterwards.

The more accurate and comprehensive you fill in tags, the greater the possibilities.

---

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 21, 2022, 12:01pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/11 "2022-06-21T12:01:33Z")

</div>

You're right. I've spent the past two days rebuilding playlists because the files names changed. If the files all had a tag that could not be changed, I could have referenced this number and rebuilt everything much faster.

I would like to create a serial number tag for all of my files. Any idea how to do this?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 21, 2022, 12:14pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/12 "2022-06-21T12:14:46Z")

</div>

> [@Dr\_H\_Vanderbear](#):
>
> If the files all had a tag that could not be changed

Anything that you could edit easily can also be changed by other users.  
Yet, if you use the files only locally, then it is very unlikely that you will remove this field.  
In the workflow, though, you either add the serial number or identifier after you have completed all the other manipulations like bitrate or format changes.

The easiest way would be:  
Load all files  
Select all files  
User Converter\>Tag-Tag  
for Field type in: SERIAL\_NUMBER  
Format string: $num(%\_counter%,6)

This works for the set of files that you have now.  
As soon as further files get added, you have to keep track of the highest number and then apply the converter again only this time with  
Format string: $num($add(x,%\_counter%),6)  
where `x` is the last serial number of the previous cycle.

---

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 21, 2022, 12:17pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/13 "2022-06-21T12:17:46Z")

</div>

This is great. I only use my files locally. I just converted bitrates on a bunch of files last night and iTunes stripped out the "Sort Album" tag from all of them. I able to fix that because I still have the original files, but I wonder if it would strip my serial number tags

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 21, 2022, 12:25pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/14 "2022-06-21T12:25:04Z")

</div>

Perhaps the serial number may be a little complicated ...  
I still favour the idea of a (user-defined) field that holds the name of the playlist to which the file belongs, and possibly the position.  
You could then filter and sort by that field and recreate the playlist with the metadata from the files ... because as soon as you e.g. change the file type from e.g. wav to flac, the extension changes, the link in the playlist is broken even though the serial number may still be stored in the file but you now have to go through all the playlists to see where that file is missing.

If you find that iTunes is messing up your tags and there is no technical reason to use iTunes, then don't use it but get decent player like Foobar2000

---

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 21, 2022, 12:35pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/15 "2022-06-21T12:35:55Z")

</div>

> [@ohrenkino](#):
>
> If you find that iTunes is messing up your tags and there is no technical reason to use iTunes, then don't use it but get decent player like Foobar2000

I don't know how else to get music onto my iPhone

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [June 21, 2022, 12:38pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/16 "2022-06-21T12:38:22Z")

</div>

as I said:

> [@ohrenkino](#):
>
> there is no technical reason

the synchronization with the iPhone seems to a technical reason.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [June 21, 2022, 1:19pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/17 "2022-06-21T13:19:18Z")

</div>

> [@ohrenkino](#):
>
> Load all files  
> Select all files  
> User Converter\>Tag-Tag  
> for Field type in: SERIAL\_NUMBER  
> Format string: $num(%\_counter%,6)

Another idea could be to fill a random number with always 5 digits with  
`$num($rand(),5)`

The randomness seems to be improved [since v3.13](https://community.mp3tag.de/t/rand-function-bug-always-naming-first-and-second-0041-and-1846/56760/4), but I would not garantuee if you use this function for lets say 99999 tracks that you never get a duplicated number. I could not find a way to tell this function to generate a value with 6 or more digits - maybe you could fill your user defined tag like this:  
`$num($rand(),5) - $num($rand(),5) - $num($rand(),5)`

As long as this duplicate doesn't appear for the same folder it should not be a problem.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 21, 2022, 2:28pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/18 "2022-06-21T14:28:31Z")

</div>

In iTunes, Edit\>Preferences\>Advanced (Tab) make sure you uncheck both "Keep iTunes Media folder organized" and "Copy files to iTunes Media folder when adding to library" to avoid having iTunes rename or move your files. It shouldn't remove tags for any reason any how, except if you make mass changes (not a good idea, and that is what you have mp3tag for!).

For the same reason with many iDevice users in my home, I still use iTunes. But I have no issues like this.

What program did you use to do this?

> [@Dr\_H\_Vanderbear](#):
>
> I just converted bitrates on a bunch of files last night

Perhaps that had some impact on this?

---

<div class="post-metadata">

### Author: ![Dr\_H\_Vanderbear](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/958977/32.png) [@Dr\_H\_Vanderbear](https://community.mp3tag.de/u/Dr_H_Vanderbear)
#### Post date: [June 21, 2022, 4:28pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/19 "2022-06-21T16:28:39Z")

</div>

> [@MotleyG](#):
>
> What program did you use to do this?

I used iTunes to convert the bitrates.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 21, 2022, 6:19pm UTC](https://community.mp3tag.de/t/mp3-file-serial-number/57671/20 "2022-06-21T18:19:38Z")

</div>

Other than using it to transfer files to your phones, and maybe streaming to AppleTV devices, I would avoid using iTunes for any other purpose. Obviously you are using mp3tag to update your metadata, so that is a big plus. For managing other changes like file conversion I would suggest you consider a specialized app like dBPoweramp or Foobar2000. Your audio files will thank you!

[Next page](https://community.mp3tag.de/t/mp3-file-serial-number/57671.md?page=2)
