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. QAudioDecoder does not understand some 24/32 bit WAV files on Ubuntu and CentOS
QtWS25 Last Chance

QAudioDecoder does not understand some 24/32 bit WAV files on Ubuntu and CentOS

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 3.0k Views
  • 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by
    #1

    Hello! Today with the help of this forum I found out how to play mp3 files with QAudioDecoder on Ubuntu and CentOS, see my previous post. But there is still some small question that I did not found the answer. I have some 24-bit WAV file that QAudioDecoder does not decode reporting "format error" on Ubuntu and CentOS. Any ideas? What packages I need to install?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you read that file with gstreamer ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dmitriano
        wrote on last edited by Dmitriano
        #3

        Hi!
        I am not sure how to test GStreamer, I tried
        gst-launch-1.0 filesrc location=incoming24.wav ! wavparse ! alsasink
        it plays sound on my Ubuntu machine, but on my CentOS, this command does not work at all with any sound including wav 16, telling the following:

        $ gst-launch-1.0 filesrc location=sounds/incoming16.wav ! wavparse ! alsasink
        Setting pipeline to PAUSED ...
        ERROR: Pipeline doesn't want to pause.
        ERROR: from element /GstPipeline:pipeline0/GstAlsaSink:alsasink0: Could not open audio device for playback.
        Additional debug info:
        gstalsasink.c(849): gst_alsasink_open (): /GstPipeline:pipeline0/GstAlsaSink:alsasink0:
        Playback open error on device 'default': Connection refused
        Setting pipeline to NULL ...
        Freeing pipeline ...

        $ gst-launch-1.0 filesrc location=sounds/incoming16.wav ! wavparse ! pulsesink
        Setting pipeline to PAUSED ...
        ERROR: Pipeline doesn't want to pause.
        ERROR: from element /GstPipeline:pipeline0/GstPulseSink:pulsesink0: Failed to connect: Connection refused
        Additional debug info:
        pulsesink.c(560): gst_pulseringbuffer_open_device (): /GstPipeline:pipeline0/GstPulseSink:pulsesink0
        Setting pipeline to NULL ...
        Freeing pipeline ...

        but on both Ubuntu and CendOS, my test app does not play incoming24.wav sound reporting "format error", the full output on CentOS is:
        $ build/SoundTest sounds/incoming24.wav
        Playing 'sounds/incoming24.wav' with audio decoder...
        PulseAudioService: pa_context_connect() failed
        QAudioDecoder Format error
        Sound buffer size = 0
        QAudio::ActiveState
        QAudio::IdleState

        the full output on Ubuntu:
        $ build/SoundTest sounds/incoming24.wav
        Playing 'sounds/incoming24.wav' with audio decoder...
        QAudioDecoder Format error
        Sound buffer size = 0
        QAudio::ActiveState
        QAudio::IdleState

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #4

          Can you also show the output of your Ubuntu machine ?

          Did you check that you have the same version of gstreamer on both machines ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dmitriano
            wrote on last edited by Dmitriano
            #5

            Saying more exactly now I have three machines: KUbuntu where this 24 bit wav sounds decodes fine, Astra (some ubuntu -like linux) and CentOS where it does not. There are different GStreamer packages installed on each machine, I listed them in a post in my blog describing my experimentation with QAudioDecoder.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              The main difference is that on Kubuntu your using GStreamer 1.0 and on the other two 0.10. The best thing to do is to upgrade all to 1.0.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dmitriano
                wrote on last edited by
                #7

                I did not notice that the versions are different, they look similar, but my Astra Linux is a closed system where I cannot update something even GCC compiler etc... The following command plays the sound on Astra:
                gst-launch-1.0 filesrc location=sounds/incoming24.wav ! wavparse ! alsasink
                so probably QT also can...

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  I might be wrong but I don't think Qt builds the pipeline the same way as you do.

                  Anyway, as an alternative, you might want to check the QtGStreamer project which allows you to more easily setup and integrate gstreamer pipelines with your Qt applications.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  D 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    I might be wrong but I don't think Qt builds the pipeline the same way as you do.

                    Anyway, as an alternative, you might want to check the QtGStreamer project which allows you to more easily setup and integrate gstreamer pipelines with your Qt applications.

                    D Offline
                    D Offline
                    Dmitriano
                    wrote on last edited by Dmitriano
                    #9

                    looks like GStreamer 0.10 does not support WAVE_FORMAT_EXTENSIBLE, at least gst-launch does not play these files, but GStreamer 1.0 does.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Then there's indeed no choice but to use 1.0 for your needs.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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