Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delay between sounds played #839

Open
j67Sv89n opened this issue Feb 19, 2024 · 3 comments
Open

delay between sounds played #839

j67Sv89n opened this issue Feb 19, 2024 · 3 comments
Labels

Comments

@j67Sv89n
Copy link

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');
        }
      });
    }
@OlivierCo
Copy link

use .wav format

@cerberusmaster
Copy link

@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

@j67Sv89n
Copy link
Author

j67Sv89n commented Jul 8, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants