Results 1 to 6 of 6

Thread: how to play song in the device ?

  1. #1
    Join Date
    Jul 2012
    Posts
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Post how to play song in the device ?

    Hi,

    I tried to play mp3 in my application its playing successfully in my simulator. I have added my mp3 in my resource folder. but in the device its not finding the path to play .

    So kindly help in this what i need to change in my code.

    Qt Code:
    1. player = new QMediaPlayer;
    2.  
    3. player->setMedia(QUrl::fromLocalFile("./IQRAV1/song/GN.mp3"));
    4. player->setVolume(100);
    5.  
    6. player->play();
    To copy to clipboard, switch view to plain text mode 


    Thanks and Regards,
    Arpita

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to play song in the device ?

    Use Phonon instead. It is much better.
    Last edited by sonulohani; 2nd August 2012 at 11:13.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to play song in the device ?

    no it's not. and if I'm not mistaken it's dropped in Qt 5.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. #4
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to play song in the device ?

    Read the documentation of qt5. http://qt-project.org/doc/qt-5.0/phonon.html
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  5. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

  6. #6
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to play song in the device ?

    Use
    Qt Code:
    1. Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory,
    2. Phonon::MediaSource(":\song.mp3"));
    3. music->play();
    To copy to clipboard, switch view to plain text mode 

    add #include "MediaObject"

Similar Threads

  1. How to play an audio file in the symbian device?
    By satya@sipl in forum Newbie
    Replies: 1
    Last Post: 19th July 2012, 07:45
  2. Replies: 0
    Last Post: 3rd May 2012, 11:33
  3. Replies: 0
    Last Post: 19th September 2011, 10:11
  4. [Tab play list]Load play lists on start
    By petrusPL in forum Qt Programming
    Replies: 0
    Last Post: 18th March 2011, 18:12
  5. How to play youtube videos in Symbian device
    By prajnaranjan.das in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 2nd February 2011, 12: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
  •  
Qt is a trademark of The Qt Company.