wxSound Noise

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Ksawery
Experienced Solver
Experienced Solver
Posts: 75
Joined: Thu Jul 25, 2019 12:31 pm

wxSound Noise

Post by Ksawery » Mon Apr 06, 2020 2:59 pm

Hello,

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)
 }
By the way, I tried using the wxSOUND_LOOP setting, but I wasn't able to terminate my app afterwards, as Stop() didn't seem to work. So this was my workaround.

Regards,
Ksawery

Ksawery
Experienced Solver
Experienced Solver
Posts: 75
Joined: Thu Jul 25, 2019 12:31 pm

Re: wxSound Noise

Post by Ksawery » Mon Apr 06, 2020 3:40 pm

I'm using Audacity to convert my mp3 files to .wav, and I'm starting to suspect it of creating a file format that causes the popping noise in wxWidgets. I'm not sure what wave format wxWidgets uses, since every .wav file that I download or tried to convert online failed to work? Only files created in Audacity seem to work, and they're creating the popping noise. The wxWidgets .wav sample files don't.

Post Reply