This is really simple BUT I saw in the forums someone asking for this as well since it’s not in the SDK by default. And that is the ability to play all of your music tracks in a “playlist” sort of fashion, one after the other. This is certainly ghetto style code but it worked for my project. Just have to name your music files 0.mp3, 1.mp3, etc.
declare this function first
[code] [lua] ------------------------------------------------------------------------------------------------------
– onComplete function for looping all the song files
fileName = “0.mp3”
count = 1
onComplete = function(event)
count = count + 1
tostring(“count”)
fileName = count…".mp3"
print(fileName)
media.playSound(fileName, onComplete )
end
[blockcode]
now use this function to start the “playlist” loop when you are ready
[code] [lua]------------------------------------------------------------------------------------------------------
– function for looping all the song files
function media.playSound(“1.mp3”, true)
media.stopSound()
media.playSound( fileName, onComplete )
end
[blockcode]
[import]uid: 9189 topic_id: 3136 reply_id: 303136[/import]