PDA

View Full Version : QSound isn't available under ubuntu desktop.



josentop
10th January 2012, 15:42
I'm trying to use QSound in my program under ubuntu desktop as below,
if (QSound::isAvailable())
{
qDebug() << "Sound is playing!";
QSound bell(QString("warnhighsound.wav");
bell.play();
}
else
{
qDebug() << "Sound isn't available!");
}
it always show 'Sound isn't available!' message to me. does't it mean QSound not work on ubuntu desktop? My Qt is nearly version (4.8)
Can anyone give some suggestion? thanks.

wysota
10th January 2012, 15:54
QSound is usually disabled on Linux because it requires presence of NAS server which is rarely deployed nowadays. Use Phonon or QtMultimedia instead.

josentop
11th January 2012, 01:09
PHONON or QtMultimedia must install the multimedia backend system, it will cause the system to be very complex. I only want to play '.wav' file simply.

wysota
11th January 2012, 08:45
Then install Network Audio System (http://radscan.com/nas.html) or just use an external commandline player such as aplay.