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



  • 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?


  • Lifetime Qt Champion

    Hi,

    Can you read that file with gstreamer ?



  • 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


  • Lifetime Qt Champion

    Can you also show the output of your Ubuntu machine ?

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



  • 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.


  • Lifetime Qt Champion

    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.



  • 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...


  • Lifetime Qt Champion

    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.



  • 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.


  • Lifetime Qt Champion

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


Log in to reply