• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3918
  • Last Modified:

Get BitRate From mp3

Hi everyone,
can anyone tell me how to get the bitrate from a mp3 file?
i'm using some id3 components to read all kind of info from a mp3 file,
but i cant find a way to read out the bitrate (and duration) of a song.
..and i was thinking , it should be possible simply by reading some file properties..
..even my windows explorer shows this info in its file properties..
..but these file properties only gave me creationdates, lengths.. no bitrates

Greetz, Tys
0
Tyzer
Asked:
Tyzer
  • 5
  • 3
  • 3
  • +1
1 Solution
 
w3timCommented:
Hi Tyzer,

This is something I've looked at before.  It's a fairly deep subject.  Well, it may be.  I'm unsure if you can get the bitrate from the headers of the file.  It may be something you have to calculate off the actual audio data.  Got to be honest I don't exactly know.

I've posted a few questions relating to Wav and MP3 data in that past.  I've still never managed to do the necessary stream converstions in VB.Net.  

In case they are of any use.
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21131927.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21142521.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21143858.html

Most of it is about byte and PCM stuff.  It was all a bit much for me at the time but it's something I will be returning too.

The information you are getting is all logged in the id3 header of the file so it can be edited and changed pretty easily.  For duration and bitrate etc I'd imagine you have get the actual audio stream.  You may well be able to find some components that do this.  There may have been one or two mentioned in posts from people on the topics I listed above.

Have a look and see if you can find anything.

Unfortunately, it has nothing to do with the file system.  That will only give you information regarding the file itself, not it's contents!

Hope this is of some help.

Tim
0
 
wyoung76Commented:
If you know how to read bits out of a file, then this page might be of some use to you:

http://www.mp3-tech.org/programmer/frame_header.html

However, unless you're testing CBR mp3s, as soon as you get VBR or ABR mp3s, all sorts of difficulties arise in determining the "correct" or average bitrate of the entire file.

If you really want to get technical, and assuming the VBR/ABR mp3s have the info tag inside, then this page will help you figure out how to pull out the information in the info tag:

http://gabriel.mp3-tech.org/mp3infotag.html

In any case, constant bitrate mp3s should always be easier, since each frame is of a known size.  And remember to skip past all the ID3 tags  :o)
0
 
w3timCommented:
Chuckle, even if the author doesn't find it useful, I did.  Cheers for that! :)!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
wyoung76Commented:
That's what I like about EE; you never know when you'll find something useful.  Even if it's not an accepted answer, it could be useful to someone else.

Glad you found it useful w3tim  :o)
0
 
w3timCommented:
Yeah, and it often happens.  It's great!!

I don't have much of a background in audio work and it's something I'm hoping to do more in at some point so it's really useful to get every bit of info I can :)!
0
 
loopstudioCommented:
What??

We STILL need a solution!

I have found that several 3rd part components doenst work, because of the possible VBR and different versioins of a MD3 tag. I have also found a solution earlier withe GetDetailsOf() Duaration and BitRate, but suddently it doesnt work anymore after a reinstall & ASR Restore of the Windows 2003 web server, so now Im also looking for a working solution to get Duration and BitRate of a MP3 file.
0
 
TyzerAuthor Commented:
Hey loop,

It's been a while since something happened with this thread,
but perhaps i can solve many questions around this topic with a single link:

http://www.un4seen.com

This is by far the best audio library that i've ever found. I takes a while to fully understand how everything works, but it's worth your time. There are many samples included to learn from.

Go check it out and good luck.

Tys
0
 
loopstudioCommented:
Hi Tyzer,

Interesting tool/library..

I just dont know if its something for me.. I spend sevral hours to see if it could read ID3 tags, if I could find some examples, or if I could find some documentation. But no luck.
But the example page with only includes other peoples webpages or products were very interesting! :)

Do You know where to find a documentation for the DLL-file? And do You know which DLL I can use to read MP3 ID3 tags?
0
 
TyzerAuthor Commented:
Follow the instructions on the us4seen website. Download the library and perhaps the .NET API as well. That should get you goin.
0
 
loopstudioCommented:
So what have You been donloading to get Your BitRate from within some code?

The BASS? The XMPlay? The MO3?
0
 
TyzerAuthor Commented:
The Bass library
0
 
loopstudioCommented:
I cannot registrate it!

I have tried both to register the free bass.dll and the bass.dll.
They both say it doesnt have the function to register within the dll files.
0
 
loopstudioCommented:
I mean register them via "REGSVR32 BASS.DLL"
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now