Help loop fix

Blitz3D Forums/Blitz3D Programming/Help loop fix

Guy Fawkes(Posted 2009) [#1]
Hi guys. Can someone show me how to load this from a loop only ONCE?



thanks!

~DS~


Abrexxes(Posted 2009) [#2]
Global music

;...................


If music = 0 then

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)

endif


simple, isnt it ;)


Guy Fawkes(Posted 2009) [#3]
i shouldve put the whole code. so ill do that. cuz this wont work. what i want it to do, is simply load the music from ram.




Abrexxes(Posted 2009) [#4]
Why a player should load music from Ram? As dreamplayer work with "playlists" you must add a new parameter (file or ram) and rewrite the function to "load" next from playlist.

The problem that nobody in the world can see if there is a track in your RAM (?) is another problem.

bye


Guy Fawkes(Posted 2009) [#5]
well, b/c on some songs, i noticed the song became garagled (screwed up), so i thought the last time i loaded the music into ram in an older version of my project, and it worked perfectly. so i thought, why not load it from ram? :)


Guy Fawkes(Posted 2009) [#6]
use the above code w/ this, it works, but keeps repeating itself. it needs to work only 1 time per song.