QAudioDeviceInfo does not find default audio device on Ubuntu

I am trying to run a basic example from the QAudioDeviceInfo class help , but Qt does not find the default sound device.

Running this code does not display output:

foreach (const QAudioDeviceInfo &deviceInfo,  QAudioDeviceInfo::availableDevices(QAudio::AudioOutput))
    qDebug() << "Device name: " << deviceInfo.deviceName();

I am running Qt Creator 2.7.1 with Qt 5.0.2 on Ubuntu 13.10. Qt Multimedia has been installed via apt-get. My pro file has QT += multimedia. My header file includes:

#include <QAudio>
#include <QAudioOutput>
#include <QAudioDeviceInfo>

Any ideas on what I might be doing wrong?

+5
source share
2 answers

It has been fixed with a simple command:

sudo apt-get install libqt5multimedia5-plugins

Qt Multimedia requires this plugin package to support audio support.

+12
source

Windows . , Qt5Multimedia.dll \Python34\Lib\site-packages\PyQt* \Qt\Tools\QtCreator\bin.

, .

+3

All Articles