there is a bug on the position.
link is the demo with the mp3 file, but I think it does it with all mp3 files.
loading an mp3 file, the position is correct with the music being listened to.
But just listen to the first 30 seconds and then click on "GOTO TO 5 SEC", which once 30 seconds are reached the music is 2 seconds behind.
link are the test and mp3 files :
https://www.karaoke5.com/public/download/test.zip.........
if OpenDialog1.Execute then
begin
MemChan.Free;
MemChan := TMemoryStream.Create;
MemChan.LoadFromFile(PChar(OpenDialog1.FileName));
BASS_ChannelStop(chan);
Chan := BASS_StreamCreateFile(True, MemChan.memory, 0, MemChan.size, BASS_STREAM_DECODE);
Chan := BASS_FX_TempoCreate(Chan, BASS_FX_FREESOURCE);
BASS_ChannelPlay(chan, True);
Timer1.Enabled:=True;
end;
procedure TForm17.Timer1Timer(Sender: TObject);
var posi:Integer;
begin
posi := Trunc(BASS_ChannelBytes2Seconds(Chan, BASS_ChannelGetPosition(Chan, BASS_POS_BYTE)) * 1000);
Label1.Text := FormatDateTime('hh:nn:ss.zzz', posi / CostanteM);
end;
.......................
Button "GOTO TO 5 SEC" :
BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, 5), BASS_POS_BYTE);