Audio-Clip is being played with delay

Hey everyone,

I implemented the sound-effects like shown in the video:

AudioSource.PlayClipAtPoint(clip, audioPlayer.transform.position, volume);

The problem is that all audio effects (laser, damage and a third I added for destrucion) are played with a heavy delay (100 - 200 milliseconds I would say?) after the event occurs.

I remember reading about something similar a few months ago. Is this a common problem? It seems that in the video it is the same. How to fix it?

Thank you so much!

Hi Aphyrus,

First of all, where are you experiencing the delay? This is important to know because the Game window in the Unity editor is just a laggy preview. Whenever something changes at runtime, the Game window tends to lag for a moment. This does not mean that your actual game will have delays as well, so treat the Game window as a preview only to check if your game generally works as expected. Only if the delays are very noticeable or if the game is extremely laggy, there might be a problem in your game.

If the delays or lags are almost not noticeable but you suspect a problem in your game, the best would be to build your game, and test the build.

That being said, you also need to check the clip outside of Unity. Maybe there is silence for 100-200 milliseconds in the clip itself. In that case, you will have to crop that part in a program like, for example, Audacity.

I hope this helped. :slight_smile:


See also:

Hi Nina,

thank you very much for your reply.

It turned out that the problem lay in my headphones using the bluetooth connection instead of the wired one without me noticing. The extra delay was caused by this and therefore was also noticeable in the video for me.

Have a great day!

I’m glad you found the problem. Thanks for letting me know what the solution was in your case. Since I don’t use bluetooth headphones, I wasn’t even aware of this potential issue. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms