像WINAMP一樣可以顯示MP3文件的歌名。歌手名。專輯等信息

解决方案 »

  1.   

    Me.MediaPlayer1.Duration          '取得正在播放的文件的总时间
    Me.MediaPlayer1.FileName          '取得正在播放的文件的文件名
      

  2.   


    Option Explicit    Private Type TagInfo
         Tag As String * 3             '找到tag三个字节
         SongName As String * 30       '歌曲名字
         Gcj As String * 30            '艺术家
         JnC As String * 30            '纪念册
         Year As String * 4            '年月份
         ZhuShi As String * 30         '注释
         LiuPai As String * 1          '流派
        End Type
    Dim CcOunt As TagInfo
    Dim FilePata  As StringPrivate Sub Command1_Click()
    Dim FileNameS As String
    Dim ret As Long
    Cdg.Filter = "Mp3文件|*.mp3"
    Cdg.ShowOpen
    FileNameS = Cdg.FileName
    If FileNameS <> "" Then
    ret = ReadFile(FileNameS)
    End If
    If ret = True Then
        Text6.Text = FileNameS
        With CcOunt
            Text1.Text = .SongName
            Text2.Text = .Gcj
            Text3.Text = .JnC
            Text4.Text = .Year
            Text5.Text = .ZhuShi
            Text8.Text = .LiuPai
        End With
    Else
       Exit Sub
    End If
    End SubPublic Function ReadFile(FileName As String) As BooleanDim L As Long
    Dim F As String * 3
    Open FileName For Binary As #1
    With CcOunt
    Get #1, FileLen(FileName) - 127, F
    If F = "TAG" Then
       ReadFile = True
            Seek #1, FileLen(FileName) - 124   '定位到124处取出30个字节是歌的名字
              Get #1, , .SongName
            Seek #1, FileLen(FileName) - 94    '定位到94(124-30)取出30个字节是唱这首歌曲的人
              Get #1, , .Gcj
            Seek #1, FileLen(FileName) - 64    '定位到64处(94-30)取出30个字节是专辑的名称
              Get #1, , .JnC
            Seek #1, FileLen(FileName) - 34    '定位到34(64-30)取出4个字节是年月日
              Get #1, , .Year
            Seek #1, FileLen(FileName) - 30    '定位到30处(34-4)取出30个字节是注释
              Get #1, , .ZhuShi
            Seek #1, FileLen(FileName) - 0     '定位到4处取出1个字节
              Get #1, , .LiuPai
         Close #1
    Else
     ReadFile = False
    End If
    End With
    End Function
      

  3.   

    http://www.mndsoft.com 输入 "MP3"进行搜索。
      

  4.   

    另外一些常见的媒体文件如WMA,RM怎么获取
      

  5.   

    Option Explicit    Private Type TagInfo
         Tag As String * 3             '找到tag三个字节
         SongName As String * 30       '歌曲名字
         Gcj As String * 30            '艺术家
         JnC As String * 30            '纪念册
         Year As String * 4            '年月份
         ZhuShi As String * 30         '注释        
         LiuPai As String * 1          '流派
        End Type
    LiuPai As String * 1   应该为  liuPai as byte
      

  6.   

    有没有写入WMA的模块?(不是调用控件,是纯代码写文件的那种)
    有没有读写RM的模块?