I have planned to do mp3 cutting and merging in VB. But I don't know how to identify whether a mp3 file is of 128kbps or 64kbps or 96kbps or anyother else.
Please Help me how to identify.
Thank You.
10-02-2003 at 12:34 AM
|
joeisaceuk Level: Guest
Re: How to get kbps info from mp3 file
Why not play the filein Windows Media player. Whilst playing, the status bar constantly updates telling you the data transfer rate such as 128kbps etc. The skin must be set to default however.
win_dir Level: VB Guru Registered: 04-08-2002 Posts: 390
Re: How to get kbps info from mp3 file
The method that "joeisaceuk" is not really programmatically sound, however if you add the windows media player activex control to one of your forms you will see that there is quite an easy way of getting the bitrate of each MP3. Just have a mess around with the methods and properties and you'll see what i mean. This is a good method because most windows computers will have a windows media player new enough to get MP3 info. Reply if you have any other questions and maybe give other people the code that you used with WMP in the end.
In a regular fixed bit rate MP3 (Identified by the first 2 bytes = $FF $FA) the indicated bitrate is found at bits 4-7 if the third byte of the header.
$7x = 96 kbs
$9x = 128 kbs
$Ax = 160 kbs
$Bx = 192 kbs .... ect...
Im' just looking into the MP3 PRO format.... more info to follow. I also have the WAV file header info' too if you need that.
I've found the ActiveX media player to be a bit unstable when you hit it with too many commands too quickly. ie when you open the control, get some info' then close it again.