Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QMediaRecorder saves a .m4a instead of .wav
Forum Updated to NodeBB v4.3 + New Features

QMediaRecorder saves a .m4a instead of .wav

Scheduled Pinned Locked Moved Unsolved Qt 6
2 Posts 2 Posters 584 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.
  • P Offline
    P Offline
    pjared
    wrote on last edited by
    #1

    Hello,
    I'm currently having a problem with QMediaCaptureSession and QMediaRecorder.

    OS : Windows 10
    Compiler : Mingw64
    Qt Creator

    I currently am using the code

        QMediaFormat format(QMediaFormat::Wave);
        format.setAudioCodec(QMediaFormat::AudioCodec::Wave);
        recorder->setMediaFormat(format);
        
        recorder->setOutputLocation(QUrl::fromLocalFile(QDir::currentPath() + "/test"));
        recorder->setAudioSampleRate(48000);
        recorder->setAudioChannelCount(1);
        recorder->record();
        session->setAudioInput(audioInput);
        session->setRecorder(recorder);
        qDebug() << "Saving recording to" << recorder->outputLocation();
    

    recorder, session, and audioInput are all pointers that are initialized earlier in the function.

    However, when I test the recordings I get a "test.m4a" file instead of a "test.wav" file, which is what I'm hoping for. If this is an issue with windows, please let me know so I can look into using a library to rewrite the files

    Any help is appreciated,
    Thanks!

    1 Reply Last reply
    1
    • I Offline
      I Offline
      Iemon
      wrote on last edited by Iemon
      #2

      Did you figure this out? Or does anyone experiencing the same? This post is quite old, but I'm having the same issue. My capturesession, mediarecorder, and fileformat all print the correct file format and codec, but no matter what I change them to, the output file is always in .mp4 and H264 (according to ffprobe), with one exception of WMV. If I don't set a file format, it gives plain .m4a. I'm on Windows with Qt 6.3.2.

      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