Parsi Coders
سورس کد بدست اوردن مشخصات mp3(ویژوال بیسیک 6) - نسخه قابل چاپ

+- Parsi Coders (http://parsicoders.com)
+-- انجمن: Software Development Programming (http://parsicoders.com/forumdisplay.php?fid=37)
+--- انجمن: Visual Basic Programming (http://parsicoders.com/forumdisplay.php?fid=39)
+---- انجمن: Visual Basic 6 (http://parsicoders.com/forumdisplay.php?fid=44)
+---- موضوع: سورس کد بدست اوردن مشخصات mp3(ویژوال بیسیک 6) (/showthread.php?tid=2274)



سورس کد بدست اوردن مشخصات mp3(ویژوال بیسیک 6) - Amin_Mansouri - 05-15-2012

با سورس زیر میتوید تگ فایل mp3 از قبیل Artist و album و year و.... بیشتر شخصات یک فایل mp3 بدست بیارید.
سورس کد:
کد:
Returning information on an MP3 file

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


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