Reading Information from an MP3 File

Environment: Visual Basic .NET

The Mp3Class has two properties:

  • ID3v1: The mp3.s ID3v1; this read-only property returns a Mp3Class.ID3v1TAG structure.
  • Mp3FileInfo: This property returns the System.IO.FileInfo of the current MP3 file.

and the following methods:

  • GetMPEGType() as MPEGType: Returns the Mpeg type of the current Mpeg file (MP3) as a Mp3Class.MPEGType enumeration.
  • GetLayer() as LayerType: Returns the Layer type of the current Mpeg file (MP3) as a Mp3Class.LayerType enumeration.
  • GetProtection() as ProtectionType: Returns the Protection type of the current MP3 file as a Mp3Class.ProtectionType enumeration.
  • IsVBR() as Boolean: Returns true if the MP3 is VBR.
  • GetXingHeader(): Returns a XingHeader structure.
  • For more information, see: http://www.multiweb.cz/twoinches/MP3inside.htm#MP3FileStructure.

  • GetBitrate() as Integer: Returns the bitrate of the current MP3 file in bits per second. If the file is VBR, it returns the average bitrate.
  • GetSamplingRateFreq() as Integer: Returns the sampling rate Frequency of the current MP3 file in Hz.
  • GetChannelMode() as ChannelMode: Returns the Channel mode of the current MP3 file as a Mp3Class.ChannelMode enumeration.
  • GetCopyRight() as CopyRight: Returns the Copyright type of the current MP3 file as a Mp3Class.CopyRight enumeration.
  • GetDuration() as Integer: Returns the duration of the current MP3 file in seconds.
  • GetDurationString() as String: Returns a string with the duration of the current MP3 file in the form of: hh:mm:ss.
  • GetGenreString(ByVal GenreID As Integer) As String: Returns the name of the genre that corresponds to the Current genreID.

I wrote a demo app that demonstrates the use of my class.

I collected all the information needed to write this class from:

Happy coding!!!

George Liaskos, T.E.I. of Piraeus, Automation Dep.

Downloads

Download demo project - 25 Kb
Download source code - 5 Kb



Comments

  • Nicely Done

    Posted by Todd on 10/22/2012 07:28am

    You have saved me hours. Thank you for your effort.

    Reply
  • mp3

    Posted by rudolfffw on 06/11/2007 01:04am

    Depok June 11, 2007.
    
    
    I am rudolf, I cant upload your source code .....so please send me the code to my email...
    
    Do you have code for made simple radio automation or music player build by VB 6, did you have please send.
    
    Thank you before
    
    Best regards,
    Rudolf
    
     email : rudolffw@yahoo.co.id

    Reply
  • reading information from an mp3 file

    Posted by sebinfrancis on 07/16/2005 01:24am

    i have created an mp3 player which play an mp3 file..now i want to play it using data streaming ... from the location itself...using createfile and readfile functions

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Wednesday, September 24, 2014 8:00 AM - 9:00 AM PDT According to a recent Forrester Research report, many companies are choosing low-code platforms over traditional programming platforms, due to the speed with which low-code apps can be assembled and tested. With customer-facing applications on the rise, traditional programming platforms simply can't keep up with the "short schedules and rapid change cycles" required to develop these applications. Check out this upcoming webinar and join Clay Richardson from …

  • The explosion in mobile devices and applications has generated a great deal of interest in APIs. Today's businesses are under increased pressure to make it easy to build apps, supply tools to help developers work more quickly, and deploy operational analytics so they can track users, developers, application performance, and more. Apigee Edge provides comprehensive API delivery tools and both operational and business-level analytics in an integrated platform. It is available as on-premise software or through …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds