Cannot save playlist
-
wrote on 24 Sept 2021, 20:44 last edited by
I am using Qt 5.12 and Visual Studio 2017 to create an audio application. I used a method shown below (CreatePlayList) to create a QMediaPlaylist. I can use the playlist to play and seek without problems. I trying to use the built in save method by calling
QString location = "M/Tools/Language/AudioServer/NewTest.txt";
bool saved = mPlaylist- >save(QUrl::fromLocalFile(location));saved is always false and no file is created.
Any thoughts or suggestions would be greatly appreciate.
Bruce
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int QtAudioWrapper::CreatePlayList(QString filename)
{
int status = -1;mMediaPlayList.clear(); if (mMediaPlayer != NULL) { mPlaylist = new QMediaPlaylist(mMediaPlayer); if (mPlaylist != NULL) { bool added = mPlaylist->addMedia(QUrl::fromLocalFile(filename)); mMediaPlayList.push_back(filename); mPlaylist->setCurrentIndex(1); status = -1; } } return(status);
}
-
Hi,
Are you sure the path is valid ?
-
wrote on 28 Sept 2021, 00:17 last edited by
Yes. I have tried both absolute paths and relative paths neither worked. I could not tell from the documentation if the location is supposed to be a file name or directory name
-
@bclay1297 said in Cannot save playlist:
NewTest.txt
I don't think that .txt is a valid playlist format extension.
-
wrote on 28 Sept 2021, 23:25 last edited by
I also tried m3u. Someone posted a comment on another site that said the playlist format was based on a plugin but there was no indication of where or what the plugin might be. I am beginning to think it is another one of those functions not implemented in the Windows version of Qt just like the QMediaRecorder.
-
m3u is available on all platforms.
Look into the plugins folder.
-
wrote on 1 Oct 2021, 21:51 last edited by
Thank you for your help I was looking in the wrong place for the plugin. It is working now
1/7