The problem: after a restart for any reason (app/phone crash, OoM, premium verification failure, etc.), the block "resumes" recording, in fact starting a new recording to the same file, thus deleting whatever was already recorded.
Possible suggestions:
- After a restart, before "resuming" a recording block, rename the existing target file (e.g. from "rec123.aac" to "rec123.backup.aac").
I tried to implement this myself but it cannot be done as a user
because the recording block will "resume" before the renaming block can
run. Even an external tool can't run fast enough in many cases.
- Alternatively, copy the target file to a backup file (same as above but keep the original). This way if the recording actually continues the user can delete backup file, and if it restarts the user doesn't lose the previously recorded audio. One big problem with this option is it could unexpectedly fill up the storage space and crash the device if no precautions are taken.
- Avoid "resuming" a recording block entirely and throw an error instead. This will allow the user to decide how to handle such a case (e.g. start a new recording with a new filename). Personally I think this is the best option, giving the user the most control and avoiding unpredicted points of failure. If this is backward-incompatible (e.g. users might rely on the existing behavior and this change could break their flows), it could be enabled via a flag in the "Audio record" block.
P.S.
I lost so many hours of audio to this, but I have no options other than Automate for my uses.
Recently made a frustrated review on Google Play, but should have come here a long time ago. The fact that Google controls the premium verification process has nothing to do with the way the app itself records to files. Additionally, this brings me to another issue: the way Automate handles premium verification errors. But I will make a separate post about this, to avoid changing the subject at hand: recorded files being rewritten after a restart.