Results 1 to 3 of 3

Thread: Reading the MP3 track length

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    1

    Angry

    Basically I cant find any info about how to extract the track length from an MP3 using VB. I haven't done any biinary file access before but I could learn so someone please give me a clue how to do this.

    Much appreciated to anyone who replies!!

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Here is where I got my info. The Read Header section will have length and a bunch of other MP3 info. But I disagree with how he is playing MP3's. There is an easier way to do it.

    http://home12.inet.tele.dk/mkaratha/

  3. #3
    Guest
    Code:
    Public Function Length()
    Static L As String * 30
        mciSendString "set MP3Play time format milliseconds", 0, 0, 0
        mciSendString "status MP3Play length", L, Len(L), 0
        sec = Round(Val(Mid$(L, 1, Len(L))) / 1000) 'Round(CInt(Mid$(l, 1, Len(l))) / 1000)
        If sec < 60 Then Length = "0:" & Format(sec, "00")
        If sec > 59 Then
            mins = Int(sec / 60)
            sec = sec - (mins * 60)
            Length = Format(mins, "00") & ":" & Format(sec, "00")
        End If
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width