Qmediaplayer still hates functioning
-
Hi all, i wrote the following code and there are no errors
#include "mainwindow.h"
#include <QApplication>
#include <QMediaPlayer>
#include <QAudioOutput>
#include <QUrl>
#include <QAudio>int main(int argc, char *argv[])
{
QApplication a(argc, argv);MainWindow w; QMediaPlayer* player = new QMediaPlayer; player->setSource(QUrl::fromLocalFile("/home/vboxuser/go.mp3")); QAudioOutput* audioOutput = new QAudioOutput(); audioOutput->setVolume(0.5); // set the volume to 50% player->play(); w.show(); return a.exec();}
but i hear no output when i run the program, this is the file location
This is running on Debian, latest release, any ideas? -
Hi,
You forgot to call
player->setAudioOutput(audioOutput);