PDA

View Full Version : QMediaPlayer doesn't play sound after deploy



AngrySkarpeta
30th May 2015, 19:16
Hi Guyz
At first, sorry if i make some mistakes in english, it's not my nativ language but i try to do my best.
I make a simple application who have to play sound when i click on button (there's a four diferent button and you can other random sound but it's not important). When i run app via QtCreator or release on my PC its run well. But when i try to deploy it on other pc, program work but doesn't play any sound. I use qwindeploy to deploy a *dll, i check path to files, and try some other things but still does't work. Someon know what can make this problem? Should i post some code, or it's a deploy problem?
Thanks for any help :-)

jefftee
30th May 2015, 21:01
How did you deploy the sound files themselves?

AngrySkarpeta
31st May 2015, 00:30
I create a Sounds folder in app folder and they are there. User have option to add more sounds, so i decide to not use a resource. I even create a PlainText to show path to files ;-/ And its good. If User add sound file is copy to Sounds folder, but still doesn't play. On my pc works perfectly. (it's program who have to teaching kids a word and letter, i make it for software engineering ). First i cant run it because program can't find a platform (dll was there, just app can't see it) so i use a QApplication::LibraryPath(".") or something really similar.

jefftee
31st May 2015, 06:04
If you have had to use QApplication::LibraryPath, then my guess is that you have not deployed a properly packaged application and one or more required plugins is missing. I would suggest that you spend some time reading the following:

http://doc.qt.io/qt-5/windows-deployment.html

Good luck.

AngrySkarpeta
31st May 2015, 12:24
I use windeployqt for automatic adding library, but even if windeploy add qwindows.dll in platforms folder program didn't run. When i add that LibraryPath and copy libegl it finally run but doesn't play sound on other pc. I add a Qt +=multimedia in project file and windeploy qt create me a audio and mediaservice folder. I read link you give and try use some option in windeployqt but it still isn't work. In my all other project i usually just write "windeployqt.exe . " and its work every time, just this time i fighting with it all week ; /

AngrySkarpeta
31st May 2015, 20:21
If i use a LibraryPath should i move all other dll somewhere ? If i dont use it, my app cant find platform (which is odd, in other program when i use windeployqt it works).


EDIT:
I try to use a

QApplication::addLibraryPath(
QApplication::applicationDirPath()
+ QDir::separator()
+ "plugins");

And copy all dll to "plugins" folder but then again app won't run, because cant find platform. It's only work when i put
QApplication::addLibraryPath(".") and i totally dont understand why... i have 24 hour to finish that project, and i'm a little bit tired. If someon have any idea, i would be so happy and greatfull.

AngrySkarpeta
1st June 2015, 11:13
Minute ago i try to compile it via Qt+visual but effect is the same. I can;t run programm until add "QApplication::addLibrary(.)" when i add this i cant hear sounds.