(For clarity, this post is a general post and not a question.) Samsung's voice recorder has a bug that sometimes deletes unfinished recordings if you start the camera. Here's how to prevent it.
TLDR summary: Minimize the app after starting a recording, by switching to a different app or going to the home screen.
Technical details:
On more recent Samsung phones, the pre-installed voice recorder app has an anti-feature that does more harm than good: if you open the camera while a recording is in progress, it no longer saves the recording like it did until a few years ago, but instead it pauses the unfinished recording. It still saves if you play a music or video in the background, but it unfortunately only pauses when starting the camera.
If the camera app takes too much RAM, Android closes the voice recorder in background, so it is unable to save the recording.
If the app was not minimized, it will restart once you exit the lock screen camera. This will cause it to delete the temporary files stored in /storage/emulated/0/Recordins/.393857 (or a different random number). You need to reveal hidden files in the settings first to see that folder.
If the app was minimized, before starting it again, move the m4a file out of /storage/emulated/0/Recordins/.393857 (or a different random number) before starting the voice recorder app.
During an active recording that was resumed after being paused, there will be two m4a files in that folder instead just one. Move out both m4a files, then end the recording from inside the app. This will save the recording because as long as the app accesses the file because the inode stays the same if a file is moved or renamed while being accessed. It's a feature of the Linux kernel that allows files to be renamed or moved without requiring exclusive access. Windows doesn't have that.
Another way is to a third-party app. But the third-party apps have no lockscreen widget like Samsung's stock app does. A third-party app I tried, Fossify voice recorder (open-source, works well but has a weakness: unfinished recordings are stored in the private caching folder (inaccessible via file manager, therefore bad), so if the device crashes, the unfinished recording is lost.
An app I used to use is ASR by NLL apps, which stored recordings in shared user storage (accessible via file manager, therefore good), but it seems it is abandoned by its developer and it was only made as 32-bit, so forget about using it in Android 14 and above.
TLDR summary: Minimize the app after starting a recording, by switching to a different app or going to the home screen.
Technical details:
On more recent Samsung phones, the pre-installed voice recorder app has an anti-feature that does more harm than good: if you open the camera while a recording is in progress, it no longer saves the recording like it did until a few years ago, but instead it pauses the unfinished recording. It still saves if you play a music or video in the background, but it unfortunately only pauses when starting the camera.
If the camera app takes too much RAM, Android closes the voice recorder in background, so it is unable to save the recording.
If the app was not minimized, it will restart once you exit the lock screen camera. This will cause it to delete the temporary files stored in /storage/emulated/0/Recordins/.393857 (or a different random number). You need to reveal hidden files in the settings first to see that folder.
If the app was minimized, before starting it again, move the m4a file out of /storage/emulated/0/Recordins/.393857 (or a different random number) before starting the voice recorder app.
During an active recording that was resumed after being paused, there will be two m4a files in that folder instead just one. Move out both m4a files, then end the recording from inside the app. This will save the recording because as long as the app accesses the file because the inode stays the same if a file is moved or renamed while being accessed. It's a feature of the Linux kernel that allows files to be renamed or moved without requiring exclusive access. Windows doesn't have that.
Another way is to a third-party app. But the third-party apps have no lockscreen widget like Samsung's stock app does. A third-party app I tried, Fossify voice recorder (open-source, works well but has a weakness: unfinished recordings are stored in the private caching folder (inaccessible via file manager, therefore bad), so if the device crashes, the unfinished recording is lost.
An app I used to use is ASR by NLL apps, which stored recordings in shared user storage (accessible via file manager, therefore good), but it seems it is abandoned by its developer and it was only made as 32-bit, so forget about using it in Android 14 and above.