Results 1 to 3 of 3

Thread: Qt multimedia

  1. #1
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Qt multimedia

    Hello, I have just started using Qt Quick, and I wanted to test QtMultimedia library with following code:

    Qt Code:
    1. import QtQuick 2.3
    2. import QtQuick.Window 2.2
    3. import QtMultimedia 5.0
    4.  
    5. Window {
    6. visible: true
    7.  
    8. Text {
    9. text: "Play!";
    10. font.pointSize: 24;
    11. width: 150; height: 50;
    12.  
    13. Audio {
    14. id: playMusic
    15. source: "C:\Users\whateverismyusername:)\Desktop\Example.ogg"
    16. }
    17. MouseArea {
    18. id: playArea
    19. anchors.fill: parent
    20. onPressed: { playMusic.play() }
    21. }
    22.  
    23. }
    24. }
    To copy to clipboard, switch view to plain text mode 

    but when I run it, application appears as expected, but when I click play audio doesn't start, any ideas what am I missing?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt multimedia

    Try forward slashes as path separator, back slashes are escape characters in most languages.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    vuletic (30th September 2015)

  4. #3
    Join Date
    Dec 2014
    Posts
    29
    Thanks
    12
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt multimedia

    Thanks, I'm used to forward slashes but when I'm on windows I always see path such as (C:\Users\user\Documents\test for ex.) so I assumed I had to use it like that, now it works fine if I play .wav file but if I try to play .ogg I get following error:
    DirectShowPlayerService::doRender: Unresolved error code 80040218 and If I checked it correctly codec is problem here.

Similar Threads

  1. QT5: Where are the multimedia libraries?
    By Rainer78 in forum Installation and Deployment
    Replies: 3
    Last Post: 12th January 2013, 09:33
  2. Qt multimedia query
    By AlishaVarkey in forum Qt Programming
    Replies: 0
    Last Post: 15th October 2012, 12:08
  3. install Qt.multimedia 1.0
    By vinayaka in forum Newbie
    Replies: 0
    Last Post: 23rd August 2011, 13:06
  4. problem with multimedia module.
    By pren in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 11th September 2010, 19:25
  5. Replies: 0
    Last Post: 29th October 2009, 19:20

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.