Repository navigation
|
Hello everyone, I'm using I noticed that the interrupted audio file exists on the disk, but it cannot be played. I tried using ffmpeg to manipulate it, but that didn't work. Sorry, I'm a complete beginner in this area. I've read some articles saying that specific audio formats are required for recovery. How can this be achieved in |
Replies: 3 comments
|
Hey, you could use tools like https://github.com/anthwlock/untrunc to handle that server-side. Recovery also will be easier with formats like WAV which is almost raw audio data. You can configure the formats by passing the options to enableFileOuput: |
|
The new rotateIntervalBytes option now supports this use case well, it will write to a new file at the specified interval so that if your recording is interrupted by an app crash you only lose the last "chunk" https://docs.swmansion.com/react-native-audio-api/docs/inputs/audio-recorder/#audiorecorderfileoptions |
|
I'm facing the same type of issue and in my case I'm changing the recorder to use CAF on iOS and FLAC on Android - both work without any extra effort. The tradeoff is the file size for those as they are much bigger than M4A, but I'm mitigating that by transcoding them back to M4A with a native module before uploading :) Another issue I'm having is when using FLAC there's a seeking issue after a kill or crash, where the seeking action puts it back at the beginning. That's probably because the seektable is written at the end, and since it was interrupted it is never written. I'm still not sure what I will do about it, if I'll try WAV or will live with the seeking issue for for now. I just thought this could be an interesting one to share. |
Hey, you could use tools like https://github.com/anthwlock/untrunc to handle that server-side.
Recovery also will be easier with formats like WAV which is almost raw audio data. You can configure the formats by passing the options to enableFileOuput:
https://docs.swmansion.com/react-native-audio-api/docs/inputs/audio-recorder#audiorecorderfileoptions