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.

Evan Teran
  • 87,561
  • 32
  • 179
  • 238
satg
  • 81
  • 1
  • 1
  • 2
  • 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 Mar 23 '11 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 http://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 Mar 23 '11 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 Mar 24 '11 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'] – user1016736 Dec 28 '13 at 00:08

4 Answers4

8

Try including it like this:

#include <QtMultimedia/QAudioOutput>

SingerOfTheFall
  • 29,228
  • 8
  • 68
  • 105
ros
  • 81
  • 1
  • 1
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.

Ilkka
  • 2,644
  • 1
  • 23
  • 27
2

try sudo apt-get install qtmultimedia5-dev

0

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

Josh Marshall
  • 159
  • 3
  • 11