Closed bmbmjmdm closed 4 years ago
react-native-audio : "^4.3.0" react-native : "0.62.0-rc.1" react : "16.11.0" using react-native-sound ? Yes
Setting up a callback with AudioRecorder.onProgress should trigger the callback after AudioRecorder.startRecording() is called
While this does appear to work on my android physical device, it does NOT appear to work on my iOS simulator
I'll just paste the code:
promptSpeaking () { AudioRecorder.prepareRecordingAtPath(this.filePath, { MeteringEnabled: true }) AudioRecorder.onProgress = (data) => { console.log("progress") } this.animateWithSound({ callback: ( ) => { this.finishAnimateWithSound() AudioRecorder.startRecording() setTimeout(this.stopRecording, 5000) } }) },
I can confirm stopRecording gets called after 5 seconds, which means AudioRecorder.startRecording must have been called too. However I don't see any "progress" logs in the console.
stopRecording
AudioRecorder.startRecording
https://github.com/bmbmjmdm/wesley-app
I found the problem! The file could not be created/written to because I was not explicitly setting the proper AudioEncoding
AudioRecorder.prepareRecordingAtPath(audioPath, { AudioEncoding: "aac" });
Version
Tell us which versions you are using ( you can see the versions in your package.json ):
react-native-audio : "^4.3.0" react-native : "0.62.0-rc.1" react : "16.11.0" using react-native-sound ? Yes
Expected behaviour :
Setting up a callback with AudioRecorder.onProgress should trigger the callback after AudioRecorder.startRecording() is called
Actual behaviour
While this does appear to work on my android physical device, it does NOT appear to work on my iOS simulator
Steps to reproduce
I'll just paste the code:
I can confirm
stopRecording
gets called after 5 seconds, which meansAudioRecorder.startRecording
must have been called too. However I don't see any "progress" logs in the console.Link to a git repo that reproduces bug
https://github.com/bmbmjmdm/wesley-app