Author Topic: Accuracy of BASS_ChannelBytes2Seconds/BASS_ChannelGetPosition?  (Read 423 times)

ujr

  • Posts: 29
Hi,

apparently it sometimes happens to me that this:

long pos = Bass.BASS_ChannelGetPosition(_sourceStream);
double elapsedtime = Bass.BASS_ChannelBytes2Seconds(_sourceStream, pos) * 1000;

called twice within about 17ms results in the same value of elapsedTime. I'm currently using Bass 2.4.13 (via Bass.Net), and ASIO (Dante Virtual Soundcard).

May this be expected behaviour? I would have expected a difference of (about) 17ms, of course. Is there any know bug with 2.4.13 - should I update?

_sourceStream comes from BASS_StreamCreateFile and decodes a multichannel wav file.

Best regards


Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 22829
If "_sourceStream" is a decoding channel (BASS_STREAM_DECODE set on it) then its position will advance each time BASS_ChannelGetData is called, by the amount of data requested in the calls. For example, if the ASIO buffer is 20ms then you will likely be requesting 20ms of data from BASS_ChannelGetData each time, and the position will advance in 20ms steps.

ujr

  • Posts: 29
Thank you! That's very helpful!