Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Playing sound file in mobile using QT
preeti last edited by
I am just trying to play a sound file in my mobile application using QMediaPlayer.
I have included the sound file in my project using Qt Resource file.
While executing mediaplayer state changes to loading & then directly to invalid media.
I have tried midi,mp3 and wave files.
My code is like this:
player = new QMediaPlayer(this);
connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(statusChanged(QMediaPlayer::MediaStatus)));
void playSound::statusChanged(QMediaPlayer::MediaStatus status)
qDebug() <<"In status changed "<<status;
qDebug() <<"media loaded ";
qDebug() <<"Invadid media ";
Please help me to play a sound in handset from a file.
Thanks in advance!!!
[EDIT: code formatting, Volker]
m_p_wilcox last edited by
I think it's a known issue that Qt Multimedia classes can't play from Qt resources (at least on Symbian). You need to deploy the file separately from your application rather than having it compiled in, then use QUrl::fromLocalFile().
The most active community for Symbian development with Qt is on the Forum Nokia discussion boards - this kind of question would probably get answered in less than an hour. :-)