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.
I'm using QMediaPlayer for this purpose.
player = new QMediaPlayer;
player
->setMedia
(QUrl::fromLocalFile("D:/proj/Resources/song/GN.mp3"));
player->setVolume(100);
player->play();
player = new QMediaPlayer;
player->setMedia(QUrl::fromLocalFile("D:/proj/Resources/song/GN.mp3"));
player->setVolume(100);
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.
player = new QMediaPlayer;
fileName
=QFileDialog::getOpenFileName(this, tr
("Open all file"), dir,
"*");
player
->setMedia
(QUrl(fileName
));
player->play();
player = new QMediaPlayer;
QString dir,fileName;
fileName =QFileDialog::getOpenFileName(this, tr("Open all file"), dir, "*");
player->setMedia(QUrl(fileName));
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.
Bookmarks