johnsonsu / react-native-sound-player

Play sound file in ReactNative
MIT License
261 stars 90 forks source link

Slight delay of playing a small sound #172

Open spyshower opened 3 months ago

spyshower commented 3 months ago

First of all this is isn't a bug.

I am trying to play a small sound (tried wav, m4a and aac) for my game in Android when the user clicks a button. There's always a small delay before playing the sound. This is definitely a sound issue because whatever else the button does, it happens immediately, except playing the sound.

I tried the 3 file formats I mentioned, tried loading the sound and resuming it, tried multiple Touchable/Pressable components, and also tried using react-native-gesture-handler with react-native-reanimated but had no improvement.

Any help please?

fabienbouchez commented 2 months ago

Also interested in the answer!

spyshower commented 2 months ago

Also interested in the answer!

Fyi, I ended up playing the sound onPressIn instead of onPress

fabienbouchez commented 1 month ago

Thanks!