Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtMultimedia (Qt 4.8): adding codecs
Forum Updated to NodeBB v4.3 + New Features

QtMultimedia (Qt 4.8): adding codecs

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OwonaVivienD
    wrote on last edited by
    #1

    Hello,

    Since, in a near future, Phonon won't be supported anymore, I've decided to start using the QtMultimedia module and to create my own library, whose features will look like Phonon's ones. Firstly I searched codecs which are already supported by Qt and my laptop; that's why I've coded this program:
    @#include <QtCore>
    #include <QtGui>
    #include <QtMultimedia>

    int main(int argc, char* argv[])
    {
    QApplication app(argc, argv);

    QTextEdit tE;
    QString str;
    str.clear();
    tE.setReadOnly(true);
    tE.show();
    
    QList<QAudioDeviceInfo> adis(QAudioDeviceInfo::availableDevices(QAudio::AudioOutput));
    QStringList codecs;
    
    tE.append(QString("<b>Available audio output device(s)</b>"));
    for(int i = 0 ; i < adis.size() ; i++)
    {
        tE.append(adis.at(i).deviceName());
    }
    tE.append(QString("<br/>"));
    
    for(int i = 0 ; i < adis.size() ; i++)
    {
        str.append("<b>Available codec(s) for ");
        str.append(adis.at(i).deviceName());
        str.append("</b>");
        tE.append(str);
        str.clear();
    
        codecs = adis.at(i).supportedCodecs();
        while(!codecs.isEmpty())
        {
            tE.append(codecs.takeFirst());
        }
    
        tE.append(QString("<br/>"));
    }
    
    return app.exec();
    

    }@

    As you may imagine, I was quite deceived when I saw that only one codec (PCM) was supported. I would also like adding few other codecs, like AAC, FLAC, MPEG and Vorbis. However, I don't know at all how I can do it; and that's why I'm asking for your help.

    Thank you in advance.

    Adishatz!

    By the way, "Vivien" is a male name in French...

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved