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: Non-Euclidean / Impossible Room - Roblox
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.
What I did was move the audio from soundservice to workspace.
I dont know what has caused this bug, because it had worked before in different games, and still does in different games of mine.
This bug is still happening. Restarting studio fixes the problem.
Repro steps:
Open a blank place an insert a sound. (Tested with sound id: 781032533)
Play the sound by clicking the green preview play button in the Properties panel (this doesn’t affect the bug, but ensures that the sound worked originally)
Press the “new place” icon (or open a new place another way).
Close the new place.
Go back to the first place and attempt the play the sound. The sound will not play and the error below appears:
FMOD 31: An invalid parameter was passed to this function. during createSound
03:31:07.278 - Failed to load SoundId 'rbxassetid://781032533'
This thread isn’t in the correct category, is marked as solved, and doesn’t have a descriptive title, so if this gets no reply from a Roblox staff member I may re-post it correctly in a couple days.
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.
I’d like to point out that this happens in online servers too. Sounds will just randomly stop working, even though they were working fine minutes beforehand. Happens in basically any game.
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.