• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

[Beatbox game] Audio delay issue



Hi everyone!

So, I'm just starting with GM and wanted to get familiar with it with a simple project: a rhythm machine.
Basically: a grid of buttons on screen, each time a button is pressed, a specific sound is played. Add a looped beat on top and you have a cool toy!

But here is my problem: each sound (for each button) is a very simple .wav (1 second max, no blank part at the start/end) but when I play it, there is clearly a half second delay between the press of a button and the sound being played. Tested on Android is getting even worse. And a rhythm game that is not perfectly responding well... It doesn't work that well ;)

Few details:
- I use a single room in 60 frames
- I tried checking a left click press with the default event
- I also tried checking for a left clik every step
- I added a counter to see if my entire game was lagging, it's not the case (the counter increment right on the click, even though it's happening after the sound being played)
- I use the audio_play_sound function
- I tried compressing or not the .wav, changing quality, mono/stereo, they are all max 20kb in size, nothing change

Any idea what could be the issue here?
- I heard about Android having sound lag, but it happens on windows also (and .5s seems ridiculously long)
- Should I try to find a dll handling better audio? If so any idea which one?

I'd be very glad to hear of a magical box to tick somewhere that would solve my issue :)
Hope you'll be able to help me!

Thanks a lot!


Up? :(

Even without having an answer to my problem, if you could just advise me a method to play a sound that you can guarantee without lag it would be awesome!
I'm being real stuck here...
Thanks in advance!

Cheers :)


Check the wav file, are you sure it doesn't have any dead space at the start of the actual sample?


Yes, I thought about that so tried with a bunch of clean samples ('bip' kind of debug sounds), checked into sound editor... They are clean :/


O sistema de áudio do fabricante de jogos não vale o preço do programa? good to know.
I recently discovered with any audio compression other than .ogg there is a 0.045 gap of silence to start the file. .wav isn't compressed. Are these .wav files that were never from a .mp3 or .m4a?