android打开wav声音

从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()<

 

你可能感兴趣的:(qt,安卓,android)