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

smiler44

Registered User.
Local time
Today, 23:08
Joined
Jul 15, 2008
Messages
674
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.
 

Users who are viewing this thread

Back
Top Bottom