I'm using the wxSound class for a short user notification, which loops in the background. However, at the start of every loop, when the app starts to play the sound file, there is a noticeable 'popping' noise, which is pretty loud. I've tried different sound files and different headsets/speakers on my system, and the issue doesn't seem to disappear. The problem also doesn't occur anywhere else on my system, so I've narrowed it down to the wxWidgets app.
Is this a known issue, and are there any potential solutions to the problem?
I'm working in Linux Mint 19.3 Cinnamon. As suggested in another forum post, I installed the 'osspd' system package to ensure that the wxWidgets sounds work on Linux.
Here's a sample of my code:
Code: Select all
wxSound* soundAlert = new wxSound("path/to/sound/file.wav"));
while(1)
{
if (!soundAlert->IsPlaying()) soundAlert->Play(wxSOUND_ASYNC)
}
Regards,
Ksawery