Unity keeps deleting my audio files... help!

Hello, I’ve had this problem for quite a while now where when I import an .mp3 or .wav file to my assets, the file will upload properly with no issue but then several minutes later I’ll look at my assets folder and the file will be gone. This does not occur with all sound files… it seems to happen less with shorter files (several seconds long), but almost always happens with music clips of a longer duration (over 30 seconds). Some longer clips have imported and then stayed in the Editor permanently, but they almost always disappear from my assets folder after several minutes, or after I’ve played the game several times in the Editor.

I’ve tried everything, from changing the film format from .mp3 to .wav, to altering the names of the files, to even changing the folder from which I’m importing the asset. Could it be that I’m importing the asset the incorrect way, or perhaps not attaching the music file to the proper GameObject? Also to note is that this does not happen with an other assets (images, meshes, animations, text, etc.)

Any help would be greatly appreciated!!!

Ah, yes…! The message I always get whenever my sound file gets deleted is this:

“A meta data file (.meta) exists but its asset ‘Assets/Sounds/main_m.wav’ can’t be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.”

Interesting. When we delete a file in the Editor, we delete the metafile. So if you get this message, it means it is most likely not due to the Editor. Is there a script that plays with all deleted files? My guess is that something somewhere uses something like File.Delete and delete your audio file.

I don’t believe so… is there a way I can search for this in the editor?

I was wondering if it could be anti-virus software or similar… Maybe check the logs? Or try turning it off for a few minutes… (if brave!). Or try changing the file permissions to make it read only and see if any programs pop up with file permission error messages. It does sound weird though!

Unfortunately, I don’t know any easy trick to find this. As mentioned by @akent99 , it can be anything inside or outside of Unity. Can you check if the same happens on another Unity version? Are you on an LTS version? You can try and check in the Editor log to see a pattern in the deletion. A funny trick you can try is setting your file in read-only mode. Then if a script inside Unity tries deleting your files you’ll get an error. Otherwise, some platforms allow auditing your file access. You could give it a go if you can’t find anything. I don’t know about your platforms but, this is how you can do it in Windows

I will try these out thank you guys!