@ jakob after I have seen your source its a litttle bit more logic why your code will not work.
procedure TForm4.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
Bass_StreamFree(Chan);
Chan := Bass_StreamCreateFile(false, PChar(OpenDialog1.FileName), 0, 0,BASS_SAMPLE_FLOAT or BASS_STREAM_PRESCAN or BASS_STREAM_DECODE or BASS_UNICODE);
Chan := BASS_FX_ReverseCreate(Chan, 2, BASS_STREAM_DECODE or BASS_FX_FREESOURCE);
Chan := BASS_FX_TempoCreate(Chan, BASS_FX_FREESOURCE);
BASS_ChannelSetAttribute(BASS_FX_TempoGetSource(Chan), BASS_ATTRIB_REVERSE_DIR, BASS_FX_RVS_FORWARD);
Bass_ChannelPlay(Chan, false);
end;
end;
procedure TForm4.Button2Click(Sender: TObject);
var
len: int64;
begin
len := BASS_ChannelGetLength(Chan, BASS_POS_BYTE);
BASS_ChannelSetPosition(Chan, len - 1, BASS_POS_BYTE);
// seek to just before then end
BASS_ChannelSetPosition(Chan, len, BASS_POS_BYTE or BASS_POS_DECODETO);
// decode to the end
ShowMessage(inttostr(Bass_ErrorGetCode()));
end;
will working here fine
If you don`t setting this
BASS_ChannelSetAttribute(BASS_FX_TempoGetSource(Chan), BASS_ATTRIB_REVERSE_DIR, BASS_FX_RVS_FORWARD);
so then of Cource you position call must be
BASS_ChannelSetPosition(Chan, 1, BASS_POS_BYTE);
// seek to just before then end
BASS_ChannelSetPosition(Chan, 0, BASS_POS_BYTE or BASS_POS_DECODETO);
Chris