Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

gentoo linux: QtCreator, QMediaPlayer fails (can't play audio)



  • Hello all,

    I'm trying to make an app that uses audio:
    After enable "QT += multimedia" in *.pro, I try to use the QMediaPlayer to reproduce background sounds in the app., but sadly does not work.

    I think that is a configuration problem. The qtcreator console reports:

    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    

    the "gstreamer" varible from qtmultimedia is disable, but after enable and recompile it, the console reports :

    Warning: "No decoder available for type 'application/x-id3'."
    

    On the other hand, can I play mp3 with qmmp

    Here is the program code:

      //play background Music
      QMediaPlayer *music = new QMediaPlayer();
      music->setMedia(QUrl("qrc:/sounds/gOh.mp3"));
      qDebug() << "Audio: " << music->isAudioAvailable();
      music->play();
    

    Please, any help will be wellcome.
    Thanks in advance.


  • Lifetime Qt Champion

    Hi,

    Maybe a silly question but do you have the GStreamer plugins installed ?



  • Hello, first, thank you very much.
    Is not a silly question.

    you mean some QtCreator plugins or from Linux system?
    In Linux system I have the next:

    [U] media-libs/gst-plugins-bad
         Available versions:  
         (0.10) 0.10.23-r3   <- I have this version
         (1.0)  1.4.5 1.6.3
    
    [I] media-libs/gst-plugins-base
    

    gentoo offers more gst plugins: http://pastebin.com/fC0cxKzT

    Greetings



  • Solved!

    reinstalling qmultimedia with gstreamer flag and installing the media-plugins/gst-plugins-libav plugin


Log in to reply