1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

[Beatbox game] Audio delay issue

Discussion in 'Legacy GameMaker Community Tech Support' started by Nico7c, Nov 20, 2016.

  1. Nico7c

    Nico7c Guest

    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!
  2. Nico7c

    Nico7c Guest

    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 :)
  3. rIKmAN

    rIKmAN Member

    Sep 6, 2016
    Check the wav file, are you sure it doesn't have any dead space at the start of the actual sample?
  4. Nico7c

    Nico7c Guest

    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 :/
  5. Tigas

    Tigas Member

    Jun 22, 2016
    O sistema de áudio do fabricante de jogos não vale o preço do programa? good to know.
  6. sitebender

    sitebender Member

    Sep 13, 2016
    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?

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice