Some platforms may have problems loading sound, for example different web browsers. You may not know about it because in some countries one type of browser may be more popular than another - so you won't have the errors but loads of others might. The same may apply to different variations on Android, etc...
So I've made this little function that will return even if the sound doesn't load properly:
function safeSound(f)
ok,result=pcall(Sound.new,f)
print(ok,result)
if ok then
return result
else
print("Error loading sound: "..f)
print(result)
return false
end
end |
If it returns false then don't use the sound, else it's ok.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
https://deluxepixel.com
Comments
Likes: Apollo14
https://deluxepixel.com