Hey guys, what's up? :)
I've been messing with the Raspberry Pi a lot lately, and I found it supports SFML, so I've been having a lot of fun with that (lol). Anyway, I notice when I use the audio API, there is a sort of static / popping type noise in the background when sound is playing.
Here are some details on my system: it's a Raspberry Pi 3, purchased in March/April of this year (so it's running a relatively new version of Raspbian, though I'm not sure how to get an exact version number). I'm also using a USB headset, and I haven't connected an HDMI monitor (getting sound to play on HDMI was another rabbit-hole of obscure config files and random forum posts, lol - I did eventually crack it, so chances are there's some related setting in some equally obscure config file, but for now that should not be a factor since I'm not using HDMI at the moment).
And here's an example of my code:
sf::SoundBuffer buff;
buff.loadFromFile("/home/my_username/Desktop/test.wav");
sf::Sound test(buff);
// Then in my event loop, on key press
test.play();
What's interesting is if I just do
system("play /home/my_username/Desktop/test.wav");
the sound plays with no popping/staticky sounds. So I know it's not my headset or the Pi. Maybe it does ".ogg" or some other format better? idk... anyway, I've Googled myself stupid and created several useless config files, and nothing seems to work. Has anyone else hear dealt with this? Thanks in advance.