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. QMediaRecorder(QMediaFormat) not support wave format

QMediaRecorder(QMediaFormat) not support wave format

Scheduled Pinned Locked Moved Solved General and Desktop
multimediaqmediarecorder
3 Posts 2 Posters 659 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.
  • B Offline
    B Offline
    Boewey
    wrote on 20 Dec 2022, 03:38 last edited by
    #1

    I use QMediaRecorder to record audio and save it as a wav format, but find that the supported formats do not include the wave format. Do I need to add any components or 3rd libs?

    code:

        QMediaFormat _out_fmt;
    
        for (auto codec : _out_fmt.supportedAudioCodecs(QMediaFormat::Encode)) {
            qDebug() << QMediaFormat::audioCodecDescription(codec);
        }
        for (auto codec : _out_fmt.supportedFileFormats(QMediaFormat::Encode)) {
            qDebug() << QMediaFormat::fileFormatDescription(codec);
        }
    

    output:

    "Free Lossless Audio Codec (FLAC)"
    "Advanced Audio Codec (AAC)"
    "MP3"
    "Dolby Digital (AC3)"
    "Windows Media Audio"
    "Apple Lossless Audio Codec (ALAC)"
    "MPEG-4 Audio"
    "Free Lossless Audio Codec (FLAC)"
    "MPEG-4 Video Container"
    "Windows Media Video"
    "AAC"
    "MP3"
    "Windows Media Audio"
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 20 Dec 2022, 05:15 last edited by
      #2

      Is that on Windows? By default Qt uses Windows Media Foundation backend, which does support PCM audio in WAV containers, but for some reason this format doesn't seem to be mentioned in the windows platform plugin. I don't know if it's a omission by mistake or intentional. You might want to ask the developers on the mailing list.

      Qt 6.4 introduced experimental ffmpeg backend that seems to at least mention this format in the code. It's a technology preview, so you might need to compile it yourself though. Target platform and backend notes.

      B 1 Reply Last reply 20 Dec 2022, 06:29
      2
      • C Chris Kawa
        20 Dec 2022, 05:15

        Is that on Windows? By default Qt uses Windows Media Foundation backend, which does support PCM audio in WAV containers, but for some reason this format doesn't seem to be mentioned in the windows platform plugin. I don't know if it's a omission by mistake or intentional. You might want to ask the developers on the mailing list.

        Qt 6.4 introduced experimental ffmpeg backend that seems to at least mention this format in the code. It's a technology preview, so you might need to compile it yourself though. Target platform and backend notes.

        B Offline
        B Offline
        Boewey
        wrote on 20 Dec 2022, 06:29 last edited by
        #3

        @Chris-Kawa said in QMediaRecorder(QMediaFormat) not support wave format:

        Is that on Windows? By default Qt uses Windows Media Foundation backend, which does support PCM audio in WAV containers, but for some reason this format doesn't seem to be mentioned in the windows platform plugin. I don't know if it's a omission by mistake or intentional. You might want to ask the developers on the mailing list.

        Qt 6.4 introduced experimental ffmpeg backend that seems to at least mention this format in the code. It's a technology preview, so you might need to compile it yourself though. Target platform and backend notes.

        Yes, I use Qt6.2.4 on Win 11.

        Thanks for you reply.

        1 Reply Last reply
        0

        3/3

        20 Dec 2022, 06:29

        • Login

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