Closed sornas closed 3 years ago
The line in question was
let (header, data) = wav::read(&mut std::io::Cursor::new(bytes)).unwrap();
I suspect the problem is the OS writing to the file continousely, and updating the timestamp. So we could solve it for that special case - but all new assettypes we add will have the same problem.
A more general solution would be to only load assets if they are older than 1s, or wait 20 frames to reload the data once. Adding a delay before we delegate to the actual loading.
I got this just now while re-loading a file. The asset loaded fine when I restarted.
We can either check if the file is done being written to in some way, or mark the file as "actually, try to load it again next frame" if the data parsing fails.