Video tutorial
Here is the code
#include "mp3player.h" #include <QApplication> #include <QMediaPlayer> #include <QFileInfo> int main(int argc, char *argv[]) { QApplication a(argc, argv); mp3player w; w.show(); QMediaPlayer* player = new QMediaPlayer; // ... player->setMedia(QUrl::fromLocalFile("C:/music.mp3")); player->setVolume(50); player->play(); return a.exec(); }