Hi! I’m having this issue when I play my game on Android cell phones. All the sound and music files are pre loaded. I touch the screen before the game starts to activate the sound, as recommended. Even so, there’s a lag of about 1 second in all of the sounds. Other than that, the game runs perfectly well. For example, if I press the jump button, the player jumps right away, but the jumping sound is played about a second after that. Is there any way to fix this problem or any kind of workaroud?
I’d be very grateful for any helpful information.
Unfortunately, this is going to either be something specific to your events or your mobile device.
I just tested and can play the not-a-vania example both via mobile browser and via aab install on my android phone without any audio delay.
Are you using the proper events? The play sound file on a channel events are better for preloaded audio (both music and sound effects), as the “play music” events are meant more for streaming audio. Are you preloading the sound files in resources, and not using the “Preload” actions? (Edit: preload actions are usually only for situations where you are dynamically unloading audio during the scene. The resources panel is what you want to set to preload sounds)
Hi, thanks for your reply. I’m using the play sound on a channel action for both music and sound effects. And both of them are preloaded in resources, not using an action to load the sound files.
If I tried to use a “play music on a channel” action to play the bg music, instead of “play sound on a channel” action, would that make any difference? I could try it but I don’t think it should work because the sound effects are lagging too, not only the music.
I’d like to post a link to a testing build of my game here so you could try it on your device but it will only work with a joystick connected to the cell phone because I haven’t made a virtual gamepad for the game yet.
No, this would be the opposite of what you want, it’d add a delay to audio as it has to load it on the fly.
I’d recommend instead posting your jump events that show the sound actions being used.
These are the events and actions that control the jump, including the sound (jump8.ogg).
Most of my sound files are ogg.
All of the sounds are lagging. The music, the jumping sound, the shooting sound (for both the player and the enemies), the explosions… everything. It starts lagging from the title screen, where there isn’t anything like jumping or shooting.
Not seeing anything glaringly wrong.
To double check, are you testing on an Apple Device?
They don’t support .ogg fully, so that could be impactful.
No, I’m not.
I’m testing it on an Android device. A Samsung Galaxy A22.