procedure Sync_Pos_End(SyncHandle : HSYNC; Channel, data, user : DWORD); stdcall;
begin
// put code to stop the stream
end;
(* Sync when a channel reaches a position.*)
if (FPos_Stop > 0) then
begin
FTempPos:= BASS_ChannelSeconds2Bytes(FChannel, Trunc(FPos_Stop / 1000));
FPos_Sync:= BASS_ChannelSetSync(FChannel, BASS_SYNC_POS or BASS_SYNC_MIXTIME, FTempPos, @Sync_Pos_End, Pointer(Self));
end;