I'm dealing with a strange issue using either sf::Sound + Buffer, or just using sf::Music.
My project renders Frames over over 1000+, yet when I load in either a wave or ogg file, it will stutter if I launch through Visual Studio, and sometimes not stutter if I run a debug.exe only, but usually does.
I'm on Windows 10, and I'm statically linking SFML. I'm using SFML 2.4.2.
As the window is in Windowed Mode, I can click and hold on the top bar, which returns the music to playing normally, but if I release it stutters and drops my render frames down to 11 from 1000+. If I also move the window the problem goes away until I stop moving the window very fast. Fullscreen mode also does the same thing. If I remove the audio, my render frames are back to normal.
I simply do this before my game loop:sf::Music gameMusic;
gameMusic.openFromFile("song.ogg");
gameMusic.play();
I've never seen such an issue before, is this a Windows 10 conflict?EDIT:
I did a quick test and only did this:
sf::Music gameMusic;
The program becomes very slow, and is fixed if I comment the line out. So it appears just declaring sf::Music is causing the issue.
I looked at my project again, and it wasn't working because I was using sf::Music prior to sf::RenderWindow. When I move the Audio code after, it works perfectly fine.
The problem still exists though, after exactly 1 MIN of run time the audio stutters and frames drop. If I don't have any audio and just declare sf::Music gameMusic; it still slows in 1 min of run time without playing.
Fixed: Apparently I was either using the wrong .dll for openal32, so I just re-copied it from SFML and it works fine now. Glad this is working now! I was confused why calling sf::Music before sf::RenderWindow would cause any issues as it should make zero difference... Little error, big problem. I noticed threads exiting like crazy prior so I thought to confirm the .dll