Recently I noticed that in one of my games the majority of the sounds weren’t working.
It only works in studio in normal testing, but when testing with a test server, or in a real server, it just doesn’t work. When i wanted to preview the audio it gave a warning and an error.
01:10:03.936 - FMOD 31: An invalid parameter was passed to this function. during createSound -warning
01:10:03.936 - Failed to load SoundId ‘rbxassetid://1301232234’ -error
I tried clearing my cache via ccleaner, and although i could preview my audio again, it still didnt properly work.
I have already checked if my volume wasnt off, or if the ID was invalid, because its been happening with multiple audios. I have also tried to test it on my phone instead of my computer, but it was the same problem. I have also tried to insert a new sound, and copy and paste the ID, but that didnt work. I have recreated the structure to play the audio and published it: https://www.roblox.com/games/933068865/Audio-Bug
It is uncopylocked, so feel free to look at it. Its basically a script in ServerscriptService that waits 30 seconds, then print “BEE” as confirmation that the sound will be played and then it should play the sound, located in SoundService.
We can see that the issue is caused when the second Studio instance is closed, it will clean up temporary files, but it doesn’t realize that some of the files (the sound file in this case) are still in use by the first Studio instance.
Ah, ok. This means that the code that does the cleanup of the temporary files can be triggered by more than just shutting down Studio. I’ll make sure to verify all the places this can happen when writing the fix.