Get volume (loudness) attribute of audio file, set volume

smiler44

Registered User.
Local time
Today, 15:15
Joined
Jul 15, 2008
Messages
678
I use Excel to randomly play music files. At some point I found out how to get the duration of the song but I cant recall where I got the How To from.
Some songs are quite quiet while others are louder.
Is there an attribute within the audio file that tells me how loud the song will be, when it plays via windows media player, if there is, how on earth do I retrieve it?

How do set / reset the volume so each song is played at the same level?

thanks smiler44
 
I now dont think there is a volume attribute.
So how do I get all the songs to play at the same loudness?

smiler44
 
I asked the question not having found an answer.
Now with more Google searches I have come across this

It seems I have a lot of learning to do. It looks complicated and time consuming, I am asking myself, is it worth the effort?

smiler44
 
"music files" is not specific enough. Each file format has its own capabilities. For example, this blog entry of mine is about WAV files, and shows how to interpret the file metadata. In the case of WAV, there is no loudness attribute.
 
I asked the question not having found an answer.
Now with more Google searches I have come across this

It seems I have a lot of learning to do. It looks complicated and time consuming, I am asking myself, is it worth the effort?

smiler44
Ask Chatgpt. That is my goto resource now. Plus it gives you the code that mostly works, but do not take as gospel.
 
I use Excel to randomly play music files. At some point I found out how to get the duration of the song but I cant recall where I got the How To from.
Some songs are quite quiet while others are louder.
Is there an attribute within the audio file that tells me how loud the song will be, when it plays via windows media player, if there is, how on earth do I retrieve it?

How do set / reset the volume so each song is played at the same level?

thanks smiler44
that's quite a bit to ask of Excel VBA, not saying it's not possible, but have you considered using a 3rd party app that can be automated using excel vba? I wonder if windows media player exposes itself to vba. (that sounded naughtier than I intended)
 
Typically, to find the volume of the loudest part of the music file, you have to read the file to find the maximum sound level in the playback file. Which unfortunately will differ from one file format to the next. Basically, most music files will NOT have a separate volume setting, because the instantaneous volume is derived from the data in the file.
 
Just to confirm there is no extended file property for Loudness with any audio file I've ever used e.g. MP3, WAV, FLAC
You are welcome to test for yourself using my free app:

 
use third party tools to "normalized" their loudness like "WavePad Sound Editor".
 
thank you for the replies and the link to extended files.
currently this is falling into the to difficult box, I thought it would be easier

smiler44
 
Thought I would come back and give an update in case others find it useful and as a way to say thank you to those that have helped me.

I Googled and YouTubed VLC to see if it can do normalisation, it can but I was probably doing it wrong so could not get it to work. I then came across a video on YouTube for MP3Gain, this is a link to a video on YouTube

Easy to download and install and following the instructions in the YouTube video, I have now got all my audio files to be of a similar volume.
I think the target is 89db but I don't know how that is measured. It sets the volume for each song to a pre-set volume, in case 89db but may have a bit of flexibility, so a song at 90db is not modified. Also did it pretty quickly, may have been able to do it quicker, if I had not asked MP3Gain to check the existing volume of each file.

smiler44
 
Just out of interest, what does ‘pretty quickly’ mean for a typical MP3 file? 10s or 10 min or ….?

Also does it work for other audio file formats such as FLAC?
 
Just out of interest, what does ‘pretty quickly’ mean for a typical MP3 file? 10s or 10 min or ….?

Also does it work for other audio file formats such as FLAC?
Simple question but the answer is harder to recall, the checking the volume perhaps 30 minutes? It had a bit over 500 audio files to look at. Sorry I let it run while I wondered away. Modifying, I will guess at perhaps less then 10 minutes.
Sorry I have no idea if it will work on other formats.

smiler44
 
No problem. Thanks

Even at say 10 mins per file, for 500 files you are talking about 80 hours or so. Thats a long time even if you weren’t at the computer for most of the time!
 
Last edited:
No problem. Thanks

Even at say 10 mins per file, for 500 files you are talking about 80 hours or so. Thats a long time even if you weren’t at the computer for most of the time!
Sorry I meant 10 minutes to do the lot, not per file, there was something like 500ish audio files

smiler44
 
Ah that’s much better 😌
However that suggests it took about 1 second per file to open, analyse, modify, save and close again. That sounds a bit unlikely to me.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom