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.