8

I am new to Qt and I'm creating a simple application which will playback an audio file. I realized that I am lacking the Qt Multimedia API for audio when I wrote:

#include <QAudioOutput>

..and I get that there is no such file.

I downloaded the latest Qt SDK framework and I can't find a way to add these APIs. I am using Qt creator IDE.

IS there a way to get the multimedia functionality working maybe as an add-on or some other way?

Thanks.

4
  • Please give more details: what is the exact version of the SDK, what platform you are on, what platform you are building for, and what did you put in your project file? Or did you just create a project with Qt Creator and didn't edit the project file at all?
    – Ilkka
    Commented Mar 23, 2011 at 19:09
  • SDK 1.1, Qt Creator 2.1 on Windows 7. Since it wasn't working for me I then tried to simply run the audio output example from doc.qt.nokia.com/4.7/multimedia-audiooutput.html. But the problem persists because of the missing QAudioOutput class and any Qt multimedia files
    – satg
    Commented Mar 23, 2011 at 21:55
  • I just downloaded Qt SDK 1.1 beta for Windows XP and used "explore Qt c++ examples" > Multimedia > Audio Devices to create a test project that built and ran fine. Also adding QT += multimedia and including QAudioOutput in another project worked. Do you have the multimedia headers in e.g. C:\QtSDK\Desktop\Qt\4.7.2\mingw\include\QtMultimedia?
    – Ilkka
    Commented Mar 24, 2011 at 10:45
  • I currently have the same problem with (from the Debian repository) Qt Creator 2.5.0 based on Qt 4.8.2 [result of 'qtcreator -version'] Commented Dec 28, 2013 at 0:08

4 Answers 4

8

Try including it like this:

#include <QtMultimedia/QAudioOutput>

0
7

Without more info it's hard to say, but possibly your include paths are just incomplete. Read https://doc.qt.io/archives/qt-4.7/qtmultimedia.html and be sure to add

QT += multimedia

to your project file.

1
  • The audiooutput example includes the 'audiooutput.pro file which has the following: "QT += multimedia widgets" Commented Dec 28, 2013 at 0:10
2

try sudo apt-get install qtmultimedia5-dev

0

in your pro. file try: QT += widgets multimedia

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.