zmxv / react-native-sound

React Native module for playing sound clips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

delay between sounds played

j67Sv89n opened this issue · comments

I have 7 sounds, 2 seconds long, in mp3 format,
sounds are pre-loaded into the array and processed by the Sound object,
all sounds have a constant full sound, without any transitions or attenuations.
I launch sounds sequentially going through them in a for loop,
but between sounds I hear the presence of a delay of about 200-400ms,
Why don't the sounds play continuously? after all, they are already loaded into the array.
Is it possible to launch the next sound in the queue 200-400ms earlier in this case? to level out this constant delay?

    function playSound(sound, callback) {
      sound.play((success) => {
        if (success) {
          console.log(`Successfully finished playing sound: ${sound._filename}`);
          callback();
        } else {
          console.log('Playback failed');
        }
      });
    }