# Detemine BITRATE for name of folder

**URL:** https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803
**Category:** Support
**Created:** [September 17, 2025, 8:54pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803 "2025-09-17T20:54:56Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [September 17, 2025, 8:54pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/1 "2025-09-17T20:54:56Z")

</div>

I often have several different versions of an album in my collection. These versions have the same album name, but often differ in the total number of tracks and, in most cases, in the encoding quality.

For this reason, I would like to include this information in the directory names.

Currently, my directories are structured as follows: ARTIST \ ORIGINALYEAR ALBUM

In future, this could look like this: ARTIST \ ORIGINALYEAR ALBUM TOTALTRACKS BITRATE

Determining the number of tracks is not a problem.

But deriving the (average?) bitrate for an album (valid for MP3, FLAC, OGG, WV, WAV, DCC audio) in a uniform manner is currently beyond my capabilities.

Does anyone have a solution for this task?

---

<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: [September 17, 2025, 9:06pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/2 "2025-09-17T21:06:44Z")

</div>

See e.g. here:

> [@calculate average bitrate](https://community.mp3tag.de/t/calculate-average-bitrate/19540):
>
> Hi. I recently tried to create .nfos with some homemade template heavily borrowing from existing scripts since scripting isn't my area of expertise smiley One thing I can't make work and I have no clue why is calculating average bitrate. I stole the "looping add and divide" formula from old scripts found in this forum section, the addition part works, not the division... ie this is supposed to display the average number : $loop(%\_filename\_ext%)$puts(Vbitrate,$add($get(Vbitrate),%\_bitrate%)…

and here:

> [@Average bitrate in folder name](https://community.mp3tag.de/t/average-bitrate-in-folder-name/8219):
>
> Hi, I'm looking for the solution to make a mass change of my folder names to include also a bitrate information. Something like this: if VBR \Dark Side of the Moon [VBR 234]\01 - Breathe else \Dark Side of the Moon [320]\01 - Breathe The following format string does not work \%artist%$if("%\_vbr%","VBR","%\_bitrate%")$num(%track%,2) - %title% What do I do wrong? Thanks!

---

<div class="post-metadata">

### Author: ![Valik](https://community.mp3tag.de/user_avatar/community.mp3tag.de/valik/32/16120_2.png) [@Valik](https://community.mp3tag.de/u/Valik)
#### Post date: [September 17, 2025, 9:15pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/3 "2025-09-17T21:15:30Z")

</div>

This is what I’m currently using.

'['$upper(%\_extension%) -$if($eql(%\_extension%,flac), [%\_bitspersample%-$cutRight(%\_Samplerate%,3)],$if($eql(%\_extension%,mp3), [%\_vbr%-%\_bitrate%],))']'

The output will look like:

[FLAC - 16-44]

[FLAC - 24-96]

[MP3 - VBR-235]

[MP3 - CBR-320]

---

<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: [September 18, 2025, 7:25am UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/4 "2025-09-18T07:25:47Z")

</div>

@Valik: Your above solution takes the `%_bitspersample%` and `%_samplerate%` from the first file only.  
It does not calculate the average bitrate for an entire album. If the bitrate of your first file differs from that of the other files, the name of the new folder will not be accurate.\*\*

AFAIK this is not easily possible as @dano wrote 13 year ago in the already linked topic:

> [@Average bitrate in folder name](https://community.mp3tag.de/t/average-bitrate-in-folder-name/8219/20):
>
> Although it renames the folder with the bitrate of the first file, not the average bitrate of the whole folder. That's not possible without some extra steps with the export tool.

\*\* This is particularly relevant for MP3 VBR (with **V** ariable **B** it **R** ates) files, where one album can have many different bit rates for its tracks.

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [September 18, 2025, 8:44am UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/5 "2025-09-18T08:44:48Z")

</div>

> [@LyricsLover](#):
>
> If the bitrate of your first file differs from that of the other files, the name of the new folder will not be accurate

I think this circumstance can be ignored if you keep the purpose of the requested folder name in mind. Hardly anyone will rip an album with different quality levels for the individual tracks. Even with a purchased album, there probably won't be a different quality level.  
Of course, with standard VBR encoding, the individual tracks differ in their bitrate. However, in my opinion, track 1 is generally sufficient for a comparative quality assessment, if we ignore exotic track 1s with almost silence or extremely little sound variation. While the folder name doesn't indicate the average bitrate of the album, it does give an approximate one, which, however, applies to all the same albums and is therefore comparable.

Perhaps the average bitrate of the entire album would be misleading for some album versions. In my experience, many versions of an album (Deluxe, Anniversary...) often have additional tracks that are limited in their frequency range (Home Demos...) and would deliver a lower bitrate when encoded, thus dragging down the average bitrate of an album.

---

<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: [September 18, 2025, 9:13am UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/6 "2025-09-18T09:13:10Z")

</div>

> [@poster](#):
>
> I think this circumstance can be ignored if you keep the purpose of the requested folder name in mind.

Sure, as long as the user is aware that this will not display the **average** bitrate. 😉

Example from my "catch of the day" album:  
Sorted by track number &nbsp;

 ![image](https://community.mp3tag.de/uploads/default/original/3X/5/1/513fd6f0947f95f48595fdefb82b55eda892b430.png) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sorted by Bitrate ![image](https://community.mp3tag.de/uploads/default/original/3X/e/5/e5ad5caafae2c37bf4bb73281bba4c9603b6301b.png)

The sum of this 11 example VBR tracks is 2'037.  
Divided by 11 tracks the **average VBR** is 185.  
The first track shows 179.  
The highest bitrate shows 212.  
The lowest bitrate shows 142.

The new folder name with above example format string would be:  
`[MP3 - VBR-179]`

> [@poster](#):
>
> Perhaps the average bitrate of the entire album would be misleading for some album versions.

+1 👍

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [September 18, 2025, 10:56am UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/7 "2025-09-18T10:56:53Z")

</div>

And here is an example for a track that drags the album-average down. 😉

 ![image](https://community.mp3tag.de/uploads/default/original/3X/6/8/68123cf33b862fea21f1028ff934bfdd9d74cce1.png)

---

<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: [September 18, 2025, 11:18am UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/8 "2025-09-18T11:18:05Z")

</div>

I got it in this quality:  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/2/6/26505667430c91f360774970b319a91c853226b2.png)

The [song #15](https://musicbrainz.org/recording/24587ae1-65a6-4a60-aa3b-dd8f035b6bef) of Wilco's "Summertheeth" is really only 23 seconds of nothing.  
Resulting in a small 952.60 KB file encoded in 320 kbps CBR mp3 😉

SCNR. I know what you mean and I agree with you.

---

<div class="post-metadata">

### Author: ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)
#### Post date: [September 18, 2025, 4:42pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/9 "2025-09-18T16:42:06Z")

</div>

You could take a look at the python script I’ve written to accomplish this task for my folders since I found it to be impossible/impractical to do in Mp3tag itself. I’ve described how I use it as a tool in Mp3tag in this unfortunate [thread](https://community.mp3tag.de/t/tool-is-executed-in-the-album-folder-preventing-it-from-renaming-it/67351/11).

**WARNING:**  
You should only attempt to use it if you’re comfortable with the command line and have a basic understanding of python so you can glean what the script will do or ideally adjust it to fit your preferences/needs.

---

<div class="post-metadata">

### Author: ![Roland](https://community.mp3tag.de/user_avatar/community.mp3tag.de/roland/32/8001_2.png) [@Roland](https://community.mp3tag.de/u/Roland)
#### Post date: [September 19, 2025, 12:20pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/10 "2025-09-19T12:20:46Z")

</div>

Many thanks to everyone who has contributed constructive suggestions here.

I will review them and am optimistic that a suitable solution will be found.

😃

30.10.26: I’am still working on this, I will give feedback when I found my way.

---

<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: [September 19, 2025, 12:29pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/11 "2025-09-19T12:29:39Z")

</div>

> [@Roland](#):
>
> I will review them and am optimistic that a suitable solution will be found.

Please let us know later which solution you have chosen for your collection.  
It's always interesting to find out what solutions other collectors use and the reasons behind them.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [October 19, 2025, 12:29pm UTC](https://community.mp3tag.de/t/detemine-bitrate-for-name-of-folder/69803/12 "2025-10-19T12:29:40Z")

</div>

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