VB and VBA Users Source Code: Returning information on an MP3 file
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Returning information on an MP3 file
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, September 26, 2001
Hits:
1108
Category:
Files/Directories/IO
Article:
The following function reads summary information stored in an MP3 file: Option Explicit Public Type MP3Info Tag As String * 3 Songname As String * 30 Artist As String * 30 Album As String * 30 Year As String * 4 Comment As String * 30 Genre As String * 1 End Type 'Purpose : Returns a type containing information about an MP3 file 'Inputs : sFileName The path and file name of the MP3 'Outputs : Returns a type containing information about an MP3 file 'Author : Andrew Baker 'Date : 19/Sep/2001 15:50 Function MP3GetInfo(sFileName As String) As MP3Info Dim sTemp As String, iFreeFile As Integer On Error GoTo ErrFailed iFreeFile = FreeFile Open sFileName For Binary As iFreeFile With MP3GetInfo Get #1, FileLen(sFileName) - 127, .Tag If Not .Tag = "TAG" Then Debug.Print "No tag for " & sFileName Else Get #1, , .Songname Get #1, , .Artist Get #1, , .Album Get #1, , .Year Get #1, , .Comment Get #1, , .Genre End If End With Close iFreeFile Exit Function ErrFailed: Debug.Print "Error in MP3GetInfo: " & Err.Description Close iFreeFile End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder