Help loop fix

Blitz3D Forums/Blitz3D Programming/Help loop fix

use the above code w/ this, it works, but keeps repeating itself. it needs to work only 1 time per song.

Global loaded
Function load()

If TrackList$(TrackPos) <> "" Then loaded = 1

If loaded

size = FileSize (TrackList$(TrackPos)) 
bank = CreateBank (size)
source = ReadFile (TrackList$(TrackPos))
ReadBytes bank, source, 0, size ;we load the sample in a bank

;And load it from there with _LoadMem
music = BASS_SampleLoadMem(1,bank,0,size,Hex$ (BASS_SAMPLE_OVER_VOL+20),0)
;the same way you can work with streams, music or flac & midi (plugins)
FreeBank bank ;now we can delete the bank

sample = BASS_SampleGetChannel(music,BASS_NULL)

BASS_ChannelPlay(sample, 1)

loaded = 0

EndIf

End Function