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

cannot play the most recent recorded audio in android #265

Open
amandeep0826 opened this issue Jun 21, 2021 · 0 comments
Open

cannot play the most recent recorded audio in android #265

amandeep0826 opened this issue Jun 21, 2021 · 0 comments

Comments

@amandeep0826
Copy link

amandeep0826 commented Jun 21, 2021

hello, I have used this package in a chat feature for sending audio files through an API. But the problem is that when I record the first file and send that. It doesn't play. Same for the second file, but when I send the third file then it plays but it plays the audio recorded in the second file. There is this difference between the recorded file and the path of the file that is being sent to the API.

this is the recorder that I have initialized

  const rec = new Recorder(`filename.aac`, {
    bitrate: 256000,
    channels: 2,
    sampleRate: 44100,
    quality: 'max',
    format: 'aac',
    encoder: 'aac',
  });

here I have started the recording on press in of record button

  const recordAudioHandler = () => {
    rec.prepare((err, fsPath) => {
      audioPath.current = fsPath;
      rec.record(response => {
        console.log({response});
      });
    });
  };

and here the recording is stopped on pressing out of the record button

 const stopRecordingAndroid = () => {
    rec.stop(response => {});
  };

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

No branches or pull requests

1 participant