c++ - QSound Unexpected null receiver while playing .wav files -


i play .wav samples of engine through out qt creator. of course first thought on qsound class, did whatever necessary play , shows me

qcoreapplication::postevent: unexpected null receiver 

which means entered wrong path file, seems simple have tried absoulte paths , etc. nothing new has happened.

sourcecode , photos, trying on windows run 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 .pro

qt += core qt -= gui qt += multimedia  target = silnik1 config += console config -= app_bundle  template = app  sources += main.cpp  resources += 

screen of path , file directory

qsound plays sounds asynchronously; you're going need start qcoreapplication first there's event loop running.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -