Seite 1 von 1
Phonon, MP3 Tags
Verfasst: 13. Februar 2010 20:33
von Silicomancer
Hello out here!
I just found out a strange behaviour of the Phonon media object. I tried to read mp3 tags of a sound file but it returns trash only.
I testet the same file with WinAmp and a common MP3-Tagger - both showed valid tags while phonon fails to read them. Also the Musik Player demo application of Qt fails (it show a lot of chinese characters only).
The call
returns
Code: Alles auswählen
QMap(("ARTIST", "???????? ???????")("DESCRIPTION", "???? ?????")("TITLE", "???? ?????"))
However "Title" should read "Body Blows" and "Artist" should read "Allister Brimble".
Anyone an idea?
--
Regards
Silcomancer
Verfasst: 15. Februar 2010 11:22
von AuE
Wich encoding?
If the other programms are able to read - there's a phonon bug or maybe the encoding is wrong. I cant reproduce this since I don't work with phonon but strange characters in the demo indicate that there is may be the/a problem.
Verfasst: 15. Februar 2010 11:44
von Jordy
AuE hat geschrieben:Wich encoding?
If the other programms are able to read - there's a phonon bug or maybe the encoding is wrong. I cant reproduce this since I don't work with phonon but strange characters in the demo indicate that there is may be the/a problem.
Encoding? I don't know. How can I find out?
Even if you don't work with phonon, you can start Qt's media player demo, don't you?
Verfasst: 15. Februar 2010 11:54
von AuE
No I cant.... have no phonon
sudo make
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/linux-g++-64 -I. -I../../../include/QtCore -I../../../include/QtGui -I../../../include/phonon -I../../../include -I../../../include/phonon_compat/phonon -I../../../include/phonon_compat -I../../../include/phonon/Phonon -I. -o main.o main.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/linux-g++-64 -I. -I../../../include/QtCore -I../../../include/QtGui -I../../../include/phonon -I../../../include -I../../../include/phonon_compat/phonon -I../../../include/phonon_compat -I../../../include/phonon/Phonon -I. -o mainwindow.o mainwindow.cpp
/opt/qtsdk-2009.05/qt/bin/moc -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/linux-g++-64 -I. -I../../../include/QtCore -I../../../include/QtGui -I../../../include/phonon -I../../../include -I../../../include/phonon_compat/phonon -I../../../include/phonon_compat -I../../../include/phonon/Phonon -I. mainwindow.h -o moc_mainwindow.cpp
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/linux-g++-64 -I. -I../../../include/QtCore -I../../../include/QtGui -I../../../include/phonon -I../../../include -I../../../include/phonon_compat/phonon -I../../../include/phonon_compat -I../../../include/phonon/Phonon -I. -o moc_mainwindow.o moc_mainwindow.cpp
g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/qtsdk-2009.05/qt/lib -o qmusicplayer main.o mainwindow.o moc_mainwindow.o -L/opt/qtsdk-2009.05/qt/lib -lphonon -lQtGui -L/opt/qtsdk-2009.05/qt/lib -L/usr/X11R6/lib64 -lQtCore -lpthread
/usr/bin/ld: cannot find -lphonon
collect2: ld returned 1 exit status
Verfasst: 15. Februar 2010 12:05
von AuE
QStringList MediaObject::metaData ( const QString & key ) const
Returns the strings associated with the given key.
Backends should use the keys specified in the Ogg Vorbis documentation:
http://xiph.org/vorbis/doc/v-comment.html
Therefore the following should work with every backend:
Note that meta data is not resolved before the metaDataChanged() signal is emitted.
A typical usage looks like this:
setMetaArtist(media->metaData("ARTIST"));
setMetaAlbum(media->metaData("ALBUM"));
setMetaTitle(media->metaData("TITLE"));
setMetaDate(media->metaData("DATE"));
setMetaGenre(media->metaData("GENRE"));
setMetaTrack(media->metaData("TRACKNUMBER"));
setMetaComment(media->metaData("DESCRIPTION"));
Verfasst: 20. Februar 2010 10:40
von Silicomancer
Sorry for the late answers.
Now I had time to try out that signal... I connect a slot to the metaDataChanged() signal:
Code: Alles auswählen
void MetaDataChanged()
{
qDebug() << demoPlayer->metaData("TITLE");
}
It is called as expected but it also does not work.
More ideas? You mentioned encoding...