I have ran into an issue with audio and I'm wondering if there is any way around it. I want it so that whenever a song is finished playing another song will begin playing. The problem is that after one song runs, about 90% of the time a second song will not play. I am not quite sure why but I believe that the problem lies with .IsPlaying. I read that it doesn't work and even when it does it still isn't working too well. Is there any way to deal with the audio problem without having the script just wait for the length of the song that is playing?
songs = {142401311, 163870179, 149761849}
workspace.Music:Play() --this is one method that I read to fix it, it doesn't quite help
wait(0.5)
workspace.Music:Pause()
wait(0.5)
workspace.Music:Stop()
while wait() do
if workspace.Music.IsPlaying == false then
selection = math.random(1, #songs)
workspace.Music.SoundId = "http://www.roblox.com/asset/?ID="..songs[selection]
if selection == 1 then
workspace.Music.Pitch = .53
elseif selection == 2 then
workspace.Music.Pitch = .75
elseif selection == 3 then
workspace.Music.Pitch = .5
end
workspace.Music:Play()
end
end

3 comments
You may want to look into the new Sound properties: TimeLength and TimePosition. http://wiki.roblox.com/index.php?title=API:Class/Sound
I already know about the new sound properties but I think they aren't quite working yet. They don't do anything at the moment.
Ah right.