audio_play_sound stops working after few plays

JelleB

Member
im trying to make footstep sounds and the footstep sounds play a few times then stop playing until i stop the animation and start it again.
GML:
if image_index = 2 or image_index = 6 then audio_play_sound(snd_footstep,100,false)
Please help.
 

JelleB

Member
could be a call stack issue. make certain the sound isn't already playing.
I tweaked my code a little bit using a counter instead of the image index and it works better but it still stops after a bit..
GML:
count += 1;
    if spd = walkspd then
    {
        if (count == 25)
        {
            count = 0;
            if !audio_is_playing(snd_footstep)
            {
                audio_play_sound(snd_footstep,1,false);
            }
        }
    }
    else if spd = runspd
    {
        if (count == 15)
        {
            count = 0;
            if !audio_is_playing(snd_footstep)
            {
                audio_play_sound(snd_footstep,1,false);
            }
        }
    }
 
Top