从assets拷贝到手机上再打开才能成功
#define APP_TEMPPATH "/storage/emulated/0/fitness/"
static int OpenSound(QMediaPlayer* &ply, QString qstrSound)
{
ply = new QMediaPlayer();
QFile dfile("assets:/"+qstrSound);
if (dfile.exists())
{
QString path=APP_TEMPPATH+qstrSound;
dfile.copy(path);
QFile::setPermissions(path,QFile::WriteOwner | QFile::ReadOwner);
ply->setMedia(QUrl::fromLocalFile(path));
ply->setVolume(100);
qDebug()<<qstrSound<<" sound copyed to phone:";
return 0;
}
return -1;
}