Author Topic: Incorrect song duration using BASS_ChannelBytes2Seconds  (Read 300 times)

mixy

  • Posts: 4
Hi all

I want to get the duration of an audio file and I am using BASS_ChannelBytes2Seconds for that

The song duration does not seem to match what I was expecting. For the example that I am using, the song duration is:
- using Bass: 74.0713 s
- using Audacity: 74.083 s
- using afinfo: 74.083250 s (OSX command line)

So, Audacity and afinfo agree but not Bass? Any idea?


    if (chan=BASS_StreamCreateFile(FALSE,pathMP3,0,0,BASS_STREAM_DECODE|BASS_STREAM_PRESCAN))
        pos=BASS_ChannelGetLength(chan,BASS_POS_BYTE);
    double time=BASS_ChannelBytes2Seconds(chan, pos);


Thanks




« Last Edit: 1 Apr '19 - 17:52 by mixy »

Ian @ un4seen

  • Administrator
  • Posts: 21991
The other 2 are only slightly higher than BASS, so it could just be that they aren't excluding delay/padding in the file, while BASS is. If you upload the file, I'll have a look at it.

   ftp.un4seen.com/incoming/