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

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • According to a recent Forrester total economic impact (TEI) study, enterprises can see a significant reduction in total cost of ownership by accessing Oracle Database in the cloud with a pay-as-you-go subscription model. This subscription service gives businesses the ability to scale up application environments for rapid prototyping, with far less time devoted to procuring licenses and deploying IT infrastructure. Read this study to learn how three different companies use Oracle Database in the cloud and the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds