Hi, I need to load and play custom audio files at runtime for a VR game I’m working on where players can load music of their own choice into the game and play them. I’ve gotten the wav and ogg files to load and play at runtime (thanks to this post) but encountered an issue with the game freezing for few seconds (most likely the game thread getting blocked). For wav files, on playing the loaded file, the log showed:
“LogAudioDerivedData: Display: Building compressed audio format OGG hash OGG wave SoundWave_1…”
Wav file was getting compressed to ogg and then getting played which was blocking the game thread (from what i gather but I can be wrong)
But, now I’m loading ogg file and the game is still freezing for few seconds (less than the wav file though). I’m loading the file asynchronously and and then passing it to an actor class that has an audio component. The loaded file is being assigned to the audio component’s sound property. No freezes till this point. Game freezes when the execution hits the “Play” node of the audio component.
Can someone tell how to overcome this game freezing? Thanks! (Using 4.23.1)