Flac file duration?

Started by Couin,

Couin

Hi friends,

A minor question, I have a short Flac file, and BASS sees its length as 372 min 49.6 seconds on loading.

I added some code to read the length on each play:
Debug.Print Format(BASS_ChannelBytes2Seconds(Jing(btnum).Strm, BASS_ChannelGetLength(Jing(btnum).Strm, BASS_POS_BYTE)), "0.00")The first play shows 22369,62 seconds, the next plays show 0,82 second.
From where the first value could come from?
I think it's a particular case. I join here a zip including the file.

I do not use BASSFlac plugin (so it is directly played with BASS), it would require to make a lot of program modifications.

Thanks :D



Ian @ un4seen

When the BASSFLAC add-on isn't loaded, BASS will use the Media Foundation FLAC decoder on Windows, so that's where the initial length estimate will be coming from.

I would recommend using the BASSFLAC add-on for FLAC support. As well as more accurate length estimates, it also has other benefits, including tag reading. The only code change you need to make is a BASS_PluginLoad call:

BASS_PluginLoad("bassflac", 0);

Couin

Hi Ian,

Thanks for answer :) I understand better now.

I done the plugingload adding and it now displays the right duration.

I will do the same for other formats plugins :)

Couin

I forgot to feedback, I get 2 lines as errors in VB6 IDE for bassflac.

bassflac:Global Const TAG_FLAC_CUE_TRACK_DATA    1 ' data track
Global Const TAG_FLAC_CUE_TRACK_PRE    2 ' pre-emphasis
changed for:Global Const TAG_FLAC_CUE_TRACK_DATA = 1  ' data track
Global Const TAG_FLAC_CUE_TRACK_PRE = 2    ' pre-emphasis

In other plugins, I catched this :

bassopus:chanmap As Byte * 255if I loook in the c version, it looks to be an array so in VB, it should be:chanmap(255) As Byte
bassdsd:Global Const BASS_TAG_DSD_COMMENT = &H0x13100 ' + index, DSDIFF comment : TAG_DSD_COMMENT structurechanged for:Global Const BASS_TAG_DSD_COMMENT = &H13100 ' + index, DSDIFF comment : TAG_DSD_COMMENT structure

Ian @ un4seen

Thanks for reporting those problems. The corrected .BAS files are up now.