Should I just put a timer in the background thread checking exists every second or so?
Memory Mapped Audio File btw or else I don’t think this is an issue anywhere else
Should I just put a timer in the background thread checking exists every second or so?
Memory Mapped Audio File btw or else I don’t think this is an issue anywhere else
I don’t think this is usually an issue. On macOS / Linux, as long as you keep a handle to file, the doesn’t get deleted until the handle is closed. On windows, you can’t delete an open file.
Oh okay interesting was thinking the user moves the file to the trash bin on accident while the plugin is using it.
You should immediately stop the playback then delete/move the file.
A lock could be necessary, or you could just lock the entire audio processing:
SuspendAudioProcessor(true);
// do the file operations...
SuspendAudioProcessor(false);