Results 1 to 7 of 7

Thread: QMediaPlayer doesn't play sound after deploy

  1. #1
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default QMediaPlayer doesn't play sound after deploy

    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 :-)

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: QMediaPlayer doesn't play sound after deploy

    How did you deploy the sound files themselves?

  3. #3
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMediaPlayer doesn't play sound after deploy

    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.

  4. #4
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: QMediaPlayer doesn't play sound after deploy

    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.

  5. #5
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMediaPlayer doesn't play sound after deploy

    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 ; /

  6. #6
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMediaPlayer doesn't play sound after deploy

    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
    Qt Code:
    1. QApplication::addLibraryPath(
    2. QApplication::applicationDirPath()
    3. + QDir::separator()
    4. + "plugins");
    To copy to clipboard, switch view to plain text mode 

    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
    Qt Code:
    1. QApplication::addLibraryPath(".")
    To copy to clipboard, switch view to plain text mode 
    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.
    Last edited by AngrySkarpeta; 31st May 2015 at 21:51.

  7. #7
    Join Date
    May 2015
    Posts
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMediaPlayer doesn't play sound after deploy

    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.

Similar Threads

  1. QMediaplayer Sound file problem
    By digimonkey in forum Newbie
    Replies: 1
    Last Post: 4th February 2018, 06:33
  2. QMediaplayer Sound status
    By digimonkey in forum Qt Programming
    Replies: 0
    Last Post: 16th March 2015, 09:56
  3. QMediaPlayer Sound not working in other PCs
    By digimonkey in forum Qt Programming
    Replies: 2
    Last Post: 13th March 2015, 05:07
  4. QMediaPlayer repeat sound
    By alenn.masic in forum Qt Programming
    Replies: 0
    Last Post: 21st February 2013, 14:46
  5. Replies: 6
    Last Post: 23rd December 2009, 10:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.