Background Music & Sound Effects Performance Problem

Of course you do. I made this project for a job application. I shared the codes in github in case people could examine the codes and find something that might work for them :wink:

Setting the FPS higher would have the opposite effect, since it’s forcing the game engine to draw more often, so you’ll have more noticeable FPS drops because of this extra workload.

With your game, 240FPS makes this problem much worse than it is, which I’m assuming is the setting you had it on when you took the video, and after setting it to 60 FPS performance actually improved.

Side-note, changing the FPS also changes the character movement speed when jumping, which I assume is unintentional (it’s super fast at 240FPS, and much slower at 60FPS).

The problem you’re seeing is related to the SimpleAudioEngine, and switching it over to the experimental::AudioEngine (it’s not really experimental) fixes it completely, even at 240FPS. The only thing you need to do is make sure to use MP3 files for the effects when using AudioEngine, because WAV files don’t seem to work, with cache was destroyed or not ready! warnings every time a WAV is played (at least on my Windows setup).