Audio issues sound buffer

Hey guys, I recently had sound playing in my game when the charater lands on a platform, but I recently got this
ERROR:GAMESYS: A sound could not be played since the sound buffer is full (32)
and now when I run my game and land on platforms, I have no error and no sound at all! How do I fix this? Im guessing this is because I made the delay 0

1 Like

Do you have no other sounds playing already?

Is your code only playing the sound once?

1 Like

Platforms are close together so it was like “ding ding ding” so im guessing first sound is still playing maybe when it repeats. The code plays the sound whenever you land on the platforms

1 Like

Open your audio file into an editor and see if it has any long silence.

Try using stop_sound when you play again to stop any other instances http://www.defold.com/ref/sound/#stop_sound

2 Likes

There is a limit to how many sounds can be played. Reducing the delay will help short term and might be enough for your game.

If not, you need to somehow select if a sound should play or not if all channels are busy.

For instance you could decide that you play at most 4 jump sounds at the same time and keep track of that with a counter. When you hit a limit you either ignore new sounds or stop some other sound before you play the new.

2 Likes

Ah alright. Is there a way I can reset it or something so that as i code it I can hear the sounds results? After getting that error i cant hear anything now

So, once you bit the sound buffer ceiling you can’t play more sounds even if you let all sounds finish before trying? Hmm, is that how it’s supposed to work @sicher. In any case, you can also increase the number of sounds and sound buffers in game.project.

It didnt work. Ive tried restarting and readding the sound but its still silent

Hmmm… Can you try restarting the editor?. If that won’t work there might be something with your sound driver and a reboot might be necessary.

1 Like

I redtsrted the editor and the laptop and it didnt work. Even tried a different .ogg file but its still silent with no error.

Are you sure the sound component is there alright and gets the “play_sound” message?

Yes. I ahvent changed the code at all. Only stop working after i got the buffer issue. I did a rebuild and it was gone

I get no errors, it just plays as if everything is working but i hear no sound

Do you get sound from other programs on your computer?

Yes, well versed in computer tech. I can hear sound on other programs and defolds sounds is at 100

Deleted my sound object and redid it exactly the same.
ERROR:GAMESYS: A sound could not be played since the sound buffer is full (32). Message ‘play_sound’ sent from main:/instance671#script to main:/level/sound#sound.

Instead of no error i got this atleast

Try to make a new blank project that plays a new sound file once.