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. Issue with QAudioDecoder

Issue with QAudioDecoder

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.9k 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.
  • BlackMambaB Offline
    BlackMambaB Offline
    BlackMamba
    wrote on last edited by
    #1

    Hello,

    I am looking at the example given to decode some audio data :

    QAudioFormat desiredFormat;
    desiredFormat.setChannelCount(2);
    desiredFormat.setCodec("audio/x-raw");
    desiredFormat.setSampleType(QAudioFormat::UnSignedInt);
    desiredFormat.setSampleRate(48000);
    desiredFormat.setSampleSize(16);

    QAudioDecoder *decoder = new QAudioDecoder(this);
    decoder->setAudioFormat(desiredFormat);
    decoder->setSourceFilename("level1.mp3");

    connect(decoder, SIGNAL(bufferReady()), this, SLOT(readBuffer()));
    decoder->start();

    The issue I have here is to be obliged to create a QAudioFormat before decoding the audio file. Indeed, it means that you already know some information (sample rate, etc ...) about the audio file you are about to decode which is rarely the case.
    Is there for example a way to decode (extract the data) of a wav file without knowing these informations such as sample rate ...,?

    Thanks for your help.

    Cheers,

    1 Reply Last reply
    0
    • BlackMambaB Offline
      BlackMambaB Offline
      BlackMamba
      wrote on last edited by
      #2

      Does someone have any idea please? :)
      Thank you very much

      1 Reply Last reply
      0
      • BlackMambaB Offline
        BlackMambaB Offline
        BlackMamba
        wrote on last edited by
        #3

        Still not? :)

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

          Hi,

          You should add which OS/Qt version you are using

          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
          • BlackMambaB Offline
            BlackMambaB Offline
            BlackMamba
            wrote on last edited by
            #5

            Hello,

            Qt 5.1 on windows.

            Cheers,

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

              Did you check the "bug report system":https://bugreports.qt-project.org/ to see if this is something known ? You might consider creating a bug report (put as much details as you can and a minimal compilable example so it can be reproduced)

              You can also start by asking on the interest mailing list, You'll find Qt's developers/maintainers there (this forum is more user oriented)

              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