wxSound sample does not work [wxWidgets-2.8.12, Ubuntu]

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
orbitcowboy
I live to help wx-kind
I live to help wx-kind
Posts: 178
Joined: Mon Jul 23, 2007 9:01 am

wxSound sample does not work [wxWidgets-2.8.12, Ubuntu]

Post by orbitcowboy » Thu Sep 08, 2011 6:32 pm

Hello,

i have a problem on my Ubuntu Linux (wxGTK-2.8.12). The sound sample, provided by wxWidgets does not play any sound, but i have sound support ( tested by listening music with rythmbox etc.). Is there any trick to get this running? Has anybody had the same problem?

I also tried the system bell (::wxBell()), it also does not work.


Many thanks in advance.
OS: Ubuntu 9.04 (32/64-Bit), Debian Lenny (32-Bit)
Compiler: gcc/g++-4.3.3 , gcc/g++-4.4.0
wxWidgets: 2.8.10,2.9.0

agkaiser
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Jan 22, 2016 6:40 pm

Re: wxSound sample does not work [wxWidgets-2.8.12, Ubuntu]

Post by agkaiser » Fri Jan 22, 2016 6:52 pm

I know this is old but I've encountered the same problem in the past few days. I found no way to make wxSound work in Kubuntu 14.04 [Codeblocks].

I did find a workaround: http://docs.wxwidgets.org/trunk/group__ ... cctrl.html
...
long wxExecute ( char ** argv,
int flags = wxEXEC_ASYNC,
wxProcess * callback = NULL,
const wxExecuteEnv * env = NULL
)
----------------------------
#include <wx/utils.h>
...
wxExecute("aplay /home/devel/KPaint-Silas/cuckoo.wav");
...

this is very fast with no spawning app hesitation.
from the default case: of Canvas::OnChar

wxExecute("aplay /home/devel/KPaint-Silas/cuckoo.wav");

//::wxBell();
// wxSound aSound(wxT("/home/devel/KPaint-Silas/cuckoo.wav"));
// aSound.Play();

//msg.Printf("aSound = %u", aSound.IsOk());
//wxMessageBox(msg, _("aSound status"));
// when uncommented, aSound=1, using ./cuckoo.wav
}
break;
}
// event. // to see possibilities like modifier key state tests and much more
wxCommandEvent kevent( wxEVT_PAINT, GetId() );
GetEventHandler()->ProcessEvent( kevent );
event.Skip();
}

User avatar
ardovm
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Aug 22, 2016 2:26 pm

Re: wxSound sample does not work [wxWidgets-2.8.12, Ubuntu]

Post by ardovm » Mon Aug 22, 2016 2:32 pm

Hello,
agkaiser wrote:I know this is old but I've encountered the same problem in the past few days. I found no way to make wxSound work in Kubuntu 14.04 [Codeblocks].
I could let wxSound play on my Ubuntu 14.04 systems by installing the osspd package.
Citing the project web site:
OSS Proxy Daemon is a Linux userland OSS sound device (/dev/[a]dsp and /dev/mixer) implementation using CUSE. Currently it supports forwarding OSS sound streams to PulseAudio and ALSA.
I hope this helps.

Post Reply