react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

delay between sounds played

Open j67Sv89n opened this issue 1 year ago • 3 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');
        }
      });
    }

j67Sv89n avatar Feb 19 '24 18:02 j67Sv89n

use .wav format

OlivierCo avatar Apr 23 '24 20:04 OlivierCo

@OlivierCo I am struggling with similar problem.

  1. I am receiving wav formmated audio buffer from the server and stores data into local file using RN. so there's an array that contains path of files.
  2. when i play files, there is a delay between files. this is bit crucial issue for dial between 2 users.

My questions:

  1. this module provides an interface to plays audiobuffer directly instead of file?
  2. I am wanna solve that delay between 2 audi files.

looking for your help. thanks

cerberusmaster avatar Jul 08 '24 17:07 cerberusmaster

@OlivierCo I am struggling with similar problem.

  1. I am receiving wav formmated audio buffer from the server and stores data into local file using RN. so there's an array that contains path of files.
  2. when i play files, there is a delay between files. this is bit crucial issue for dial between 2 users.

My questions:

  1. this module provides an interface to plays audiobuffer directly instead of file?
  2. I am wanna solve that delay between 2 audi files.

looking for your help. thanks

dude, I think you just need to think with your head first, or use some kind of hack, as always, otherwise things won't work, I don't know what you have there, but if you have a series of files to play, I'll give you a hint, for example you can use a loop.

j67Sv89n avatar Jul 08 '24 19:07 j67Sv89n