Open SulthanNK opened 4 months ago
For stopping the recording, you can directly attempt to stop the recorder, remove the record back listener, and then update your state.
const onStopRecord = React.useCallback(async () => {
try {
const result = await audioRecorderPlayer.stopRecorder();
audioRecorderPlayer.removeRecordBackListener();
setIsRecording(false);
console.log("Stopped recording:", result);
} catch (error) {
console.error("Error stopping the recording:", error);
}
}, []);
found the solution here
Even though using the stopRecorder method. it shows 'already stopped' but keeps recording the audio
faced the same issue but apparently, it was happening because you declared the audio player inside your component when it should have been outside, like this >>
import....
const audioRecorderPlayer = new AudioRecorderPlayer();
const App()=>{}
Even though using the stopRecorder method. it shows 'already stopped' but keeps recording the audio