Edit: just saw the error in the title, sorry it was “using” of course.
Anyways i just realised i have another problem, it seems like when i use the audio the way is described down there, im having like 0.5 second lag or something, the audio plays with some lag compared to the simulator and the way is meant to be played, i promise my volume is up now, any solution for this little lag?
EDIT: I’m such a dumb, i had the volume all the way down lol…
SOLVED:
Hello there, i’m having a problem when i try to play an audio in Android (cant test in iOS since i dont own any iOS device), the sound works perfectly in the simulator, but once i compile it and test it it doesnt play at all, this is the code im using right now:
local bgm = audio.loadStream("backgroundmusic.ogg") local bgmchannel= audio.play(bgm,{loops=-1})
Thats for a background music, when i move to the next scene i do:
audio.stop(bgmchannel)
to stop it.
For a regular sound, like a “confirm” sound when you select an option, i do:
local okay = audio.loadStream("confirm.ogg") local okaychannel= audio.play(okay)
and i dont stop it, since its not a long sound nor a looping one.
All of this seems to work ok in the simulator, but i cant play it at all in Android, im not sure if it doesnt support ogg, or if i should play the sounds in a different way, or if i should add them to the scene (im using storyboards).
Any sugestions?