问题
I'm using Phonon to get meta data about songs. On Linux everything seems to work just fine. Here's the code that get's called once the metadata is ready:
QMultiMap<QString, QString> metaData = libAddMetaDataObject->metaData();
QString fileName = libAddMetaDataObject->currentSource().fileName();
QString songName = metaData.value("TITLE");
QString artistName = metaData.value("ARTIST");
QString albumName = metaData.value("ALBUM");
qint64 duration = libAddMetaDataObject->totalTime() / 1000;
if(songName.isNull()){
DEBUG_MESSAGE("Null Title value")
songName = getUnknownTitle();
}
if(artistName.isNull()){
DEBUG_MESSAGE("Null artist value")
artistName = getUnknownArtist();
}
if(albumName.isNull()){
DEBUG_MESSAGE("Null album value")
albumName = getUnknownAlbum();
}
When I'm on my Mac, artist name and album name are ALWAYS null. Does anyone know why this is happening? Is there an issue with the Phonon-Quicktime backend?
回答1:
In case anyone is still interested in this, the best I can tell is that the phonon_qt7 backend is deficient in this area (is it just me or do all the phonon backends seem to be horribly deficient in one area or another?). My solution was just to use taglib for metadata retrieval.
来源:https://stackoverflow.com/questions/9959576/phonon-cant-get-metadata-on-mac