Results 1 to 3 of 3

Thread: How To Use Phonon?

  1. #1
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default How To Use Phonon?

    Hai Guys, im new with Qt
    I had a problem
    I want to make a music player simulator (like piano or drum)
    recently, i'm using QSound, but i have problem because i cant play multiple sound

    I want to try using Phonon. But i found a problem...
    My Code is

    void uxbonang::bon_play(){
    Phonon::MediaObject *music =
    Phonon::CreatePlayer (Phonon::MusicCategory,
    Phonon::MediaSource("C://Qt/Pro/sound.wav"));
    }

    i already included
    phonon/MediaObject
    phonon/MeidaSource

    But i got an error message like this

    "......undefined reference to '_imp__ZN6Phonon11MediaSourceC1ERK7QString'
    ...undefined reference to '_imp__ZN6Phonon12CreatePlayerENS_8CategoryERKNS_1 1MediaSourceE'
    ...undefined reference to '_imp_ZN6Phonon11MediaSourceD1Ev'
    ...undifned reference to '_imp_ZN6Phonon11MediaObjectPlayEv'
    "

    What should i Do?
    thx

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How To Use Phonon?

    Add
    Qt Code:
    1. QT += phonon
    To copy to clipboard, switch view to plain text mode 
    to your .pro file

    Then clean the project and rebuild.

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

    ardisaz (28th November 2010)

  4. #3
    Join Date
    Nov 2010
    Posts
    23
    Thanks
    10
    Qt products
    Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: How To Use Phonon?

    thank you very much
    now i can run my project
    but i have warning like this " c:\NokiaQtSDK\Simulator\Qt\mingw\lib\QtCore.rl:1:U nescaped backslahsed are deprecated". its that oke?
    and i when i touch play, the sound didn't play

    again, thanks for your help


    Added after 24 minutes:


    Oh, it works...
    Phonon cant read wav extension i guess, so i try to play mp3 and it worked well

    one question, if everytime i touch the button play (like playing piano) with this code
    void uxbonang::bon_play(){
    Phonon::MediaObject *music =
    Phonon::CreatePlayer (Phonon::MusicCategory,
    Phonon::MediaSource("C://Qt/Pro/sound.wav"));
    }

    its meant that we create a lot of object music right? is that okey?
    because i try to make variabel music outside the void and do the instantiation outside the void, when i try to play it, it only play the sound once. after that, the sound didn't play anymore...
    Last edited by ardisaz; 28th November 2010 at 18:57.

Similar Threads

  1. Phonon
    By lamp in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 6th October 2010, 11:17
  2. Phonon V4L
    By kovariadam in forum Newbie
    Replies: 1
    Last Post: 31st January 2009, 15:35
  3. phonon on QT4.4
    By coolk in forum Installation and Deployment
    Replies: 15
    Last Post: 15th January 2009, 13:38
  4. Phonon
    By QTInfinity in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2008, 14:24
  5. Phonon and Mac
    By SidGBF in forum Qt Programming
    Replies: 5
    Last Post: 8th September 2008, 13:11

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.