Sound on collision not fast enough?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Danilo

Hi, someone know what is the most responsive way to play a sound after a collision?

I’m using Area2d to send signal inside an instanced scene, and then playing by AudioStreamPlayer from that scene, but I’m having a slight delay about 0.1 sec.

Is that normal, or Im doing something wrong.
EDIT: maybe there is a way to add sounds to a buffer?

Did you check your sound file? (i.e. with audacity). Perhaps the most part of the delay is inside the sound data.

wombatstampede | 2020-03-30 09:54

To combat sound latency inherent to real-time audio engines, you can also find a way to play the sound just before the collision (if it’s very likely to happen). You could use a RayCast node to predict this.

Calinou | 2020-03-30 14:59

Problem is also that the delay is not always the same.
I’m making a percussion app based on collisions so its pretty noticeable

Danilo | 2020-03-30 18:39

:bust_in_silhouette: Reply From: Danilo

I used audiostream2d and it sounds much better