Nice! I really like how many variations on this idea are coming out. MacWhisper used to be great, but is kinda of a buggy mess now. I'm making my own, for personal use. I did a survey of many and they all (that I could find) skip the fundamentals. The major issues that I've run into: - Crash recovery. Most of these apps are incredibly buggy and crash all the time, taking the recorded audio with them. Macwhisper is in…
Crash recovery is definitely something that I want to spend a bit more time on. I'm not entirely sure how Trace handles crashing right in the middle of a recording, so I'm going to put a bit of time aside in the next few days to properly explore this and see if I can come up with an elegant solution to it. I think I've got the other two bits covered. I pushed an update yesterday that adds active echo cancellation so…
- Journaling file structures (telegraph what you're about to write, then write it, then signal completion)
- memmap your important data structures to a file (they will be flushed to disk no matter how your app dies - short of a power loss)
- post-crash dump (put last-minute writers in a crash handler to save it to disk)
A journaling file structure is the most secure, because it's designed with the assumption that writing will eventually fail. memmapped structs are easy and cheap, and get you 99% of the way there (only power loss will lose your data). Crash-time writing is doable with a crash handler like KSCrash, but there are many ways an app can crash without triggering a crash handler (thermal kill, exceeding quota, memory jetsam, etc). You also need to write your data in a signal-safe manner.