Author Topic: how to know how long a track is?  (Read 2310 times)

tapeworm22

  • Posts: 4
how to know how long a track is?
« on: 13 Jun '03 - 17:16 »
how can i get the information about the length of an mp3? i've tried to use this function:
 BASS_StreamGetLength()
and then:
 BASS_ChannelBytes2Seconds
but always the length i get is not equal "the real" length of a track, it's always longer?
why does it happen? are there any other ways to get the length of a track?

I

  • Posts: 0
Re: how to know how long a track is?
« Reply #1 on: 13 Jun '03 - 18:36 »
Dim X As Long
Dim TotalTimeInSeconds As Long

X = BASS_StreamGetLength(channel)
TotalTimeInSeconds = BASS_ChannelBytes2Seconds(channel, X)

« Last Edit: 13 Jun '03 - 18:39 by I »

(: JOBnik! :)

  • Posts: 1080
Re: how to know how long a track is?
« Reply #2 on: 13 Jun '03 - 20:25 »
Hi ;D

Try using a flag: BASS_MP3_SETPOS
when creating a stream, e.g:

handle = BASS_StreamCreateFile(BASSFALSE,filename,0,0,BASS_MP3_SETPOS)

Have fun!

8) JOBnik! 8)