I would like to play .wav samples of engine through out Qt creator. Of course the very first thought was on QSound class, but I did whatever was necessary to play it and it always shows me
QCoreApplication::postEvent: Unexpected null receiver
Which means that I entered wrong path for file, it seems simple but I have tried with absoulte paths and etc. Nothing new has happened.
Sourcecode and photos, I am trying it on windows but I would like to run it on Raspberry(fedora).
#include <QCoreApplication>
#include <QSound>
#include <iostream>
#include <QMediaPlayer>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QSound let("music/letitplay.wav");
let.play();
/*QMediaPlayer * music = new QMediaPlayer();
music->setMedia(QUrl("qrc:/sounds/letitplay.wav"));
music->play();
*/
return 0;
}
Snippet from .pro
QT += core
QT -= gui
QT += multimedia
TARGET = silnik1
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
RESOURCES +=