All I want to do write a programm in Qt that plays a simple .wav file. This works perfectly on the PC where my Qt runs, but whenever I want to run the program on a different computer there is no sound. I couldn't find any solution for this problem anywhere yet.
This is what I tried so far:
- different libraries: QSound, QSoundEffect, QMediaPlayer
- implement the QT += multimedia in the .pro file (of course)
- make sure that the filepath was correct (even with a absolute path):
QFile dir("C:/Sounds/countdown3.wav");
if(dir.exists()){
ui->labelSound->setText("File found!");
ui->pushButtonPlay->setEnabled(true);
ui->labelplay->setEnabled(true);
ui->pushButton->setEnabled(false);
}
else ui->labelSound->setText("File not available!");
(When I rename the file I get the "File not available!" message, so this works.)
To deploy the program from my pc to my laptop, I put the following into a folder:
- PlaySound.exe
- platforms/qwindows.dll
- icudt53.dll
- icuin53.dll
- icuuc53.dll
- libgcc_s_dw2-1.dll
- libstdc++-6.dll
- libwinpthread-1.dll
- Qt5Core.dll
- Qt5Gui.dll
- Qt5Multimedia.dll
- Qt5Network.dll
- Qt5Widgets.dll
and the "Sounds" folder with countdown3.wav to the C:/ -drive. Still no sound :(
What am I missing?
I hope you can help me!