Unity stops working when I play the game in editor


This happened not so long ago… I was importing audio files into my Unity project, just to realise that the files weren’t either MP3 or OGG. I removed them from assets and converted them to MP3, then I imported them into the project again (this time as MP3). I had a script that was working pretty well, and that script was supposed to use the audio files. Then I selected the audio files in the inspector. This far everything seemed normal untill I started the game. The game ran for a while until I used an input command in the script that would activate the sound. Unity stopped working and I had to manually close the proces. I opened Unity again and saw a message in the debug log saying something similar to “FILENAME.m4a has been deleted because it has crashed”. I didn’t care too much about the message, because I had already deleted the M4A audio files. Now when I try to use the script (activating MP3 AudioClips) or try to run the game for more than 10 seconds Unity crashes. Is there a possibility that the files became corrupt? Or is there an other explenation to this? I would also like to have an answer on how to solve this problem as well. So if you have any knowledge of this, then you are welocme to leave an answer or a comment.

If you suspect that something could be corrupted, try exporting all the assets out as a package and reimporting them into a new project. That’s worked for me the couple times I’ve gotten a corrupted project.

It turned out to be a script that had some problems, I rewrote the script and now everything works. Thanks for the help anyway!