Why am I missing the Qt Multimedia functionality?
Asked Answered
C

4

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.

Christiano answered 23/3, 2011 at 18:55 Comment(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?Gunpoint
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 filesChristiano
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?Gunpoint
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']Icy
N
8

Try including it like this:

#include <QtMultimedia/QAudioOutput>

Namhoi answered 30/1, 2012 at 18:58 Comment(0)
G
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.

Gunpoint answered 23/3, 2011 at 19:17 Comment(1)
The audiooutput example includes the 'audiooutput.pro file which has the following: "QT += multimedia widgets"Icy
M
2

try sudo apt-get install qtmultimedia5-dev

Monochromatism answered 19/3, 2014 at 8:59 Comment(0)
U
0

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

Underclay answered 30/6, 2015 at 10:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.