Results 1 to 2 of 2

Thread: How to play an audio file in the symbian device?

  1. #1
    Join Date
    Jul 2012
    Posts
    21
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Question How to play an audio file in the symbian device?

    Hello every one.

    I have written some code to play an audio(.mp3) for my Symbian device.
    I'm using two methods for the above reason.
    First method
    I'm using QMediaPlayer for this purpose.
    Qt Code:
    1. player = new QMediaPlayer;
    2.  
    3. player->setMedia(QUrl::fromLocalFile("D:/proj/Resources/song/GN.mp3"));
    4.  
    5. player->setVolume(100);
    6.  
    7. player->play();
    To copy to clipboard, switch view to plain text mode 

    Here it is only playing the audio on the simulator. But on device it is not working. I think the path has some problem. I do not know how to solve it.

    Second method
    Qt Code:
    1. player = new QMediaPlayer;
    2.  
    3. QString dir,fileName;
    4.  
    5. fileName =QFileDialog::getOpenFileName(this, tr("Open all file"), dir, "*");
    6.  
    7. player->setMedia(QUrl(fileName));
    8.  
    9. player->play();
    To copy to clipboard, switch view to plain text mode 

    Here also it is working fine in simulator, but not on device. Here I do not know the exact problem.

    Please help me to find a solution to this problem.

    Thanks to all in advance.

  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 an audio file in the symbian device?

    Use Phonon instead.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

Similar Threads

  1. How to record and play an audio file in qml?
    By harish in forum Qt Quick
    Replies: 2
    Last Post: 17th February 2012, 14:42
  2. play audio file
    By hema in forum Qt Quick
    Replies: 1
    Last Post: 11th August 2011, 05:27
  3. how to play audio file in qml
    By hema in forum Newbie
    Replies: 0
    Last Post: 10th August 2011, 10:57
  4. 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
  5. Phonon won't play audio file
    By kar in forum Qt Programming
    Replies: 5
    Last Post: 29th October 2010, 01:41

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.