[Interest] Audio Metadata issue in Qt5.2.x

Ramakanthreddy Kesireddy Ramakanthreddy.Kesireddy at techmahindra.com
Thu Oct 17 15:39:22 CEST 2013


Iam trying to retrieve metadata using Qt5.2 alpha on ubuntu 12.04.

The below code in QtQuick 2.0 returns metadata (ex:albumArtist)

Rectangle {
    width: 360
    height: 360

    Text {
        text: "Click Me!";
        font.pointSize: 24;
        width: 150; height: 50;

        MediaPlayer {
            id: playMusic
            source: "music.mp3"
        MouseArea {
            id: playArea
            anchors.fill: parent
            onPressed:  { console.log(playMusic.metaData.albumArtist)

However, in Qt, the same below code returns NULL while retrieving metadata. am wondering what could be the problem in this regard though it invokes QMediaObject->metadata function from both QtQuick and Qt.

    QUrl filename = QUrl::fromLocalFile("music.mp3");
    QMediaPlayer *mediaPlayer = new QMediaPlayer(this);

    qDebug() << "Player error state -> " << mediaPlayer->error();
    qDebug() << "Media supported state -> " << QMediaPlayer::hasSupport("audio/mp3");

    QString album = mediaPlayer->metaData(QMediaMetaData::AlbumArtist).toString();
    qDebug() << album;

Please let me know if there is any issue in above code snippet.

Thanks and Regards,


This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131017/0b589ed2/attachment.html>

More information about the Interest mailing list