QMediaRecorder saves a .m4a instead of .wav
-
Hello,
I'm currently having a problem with QMediaCaptureSession and QMediaRecorder.OS : Windows 10
Compiler : Mingw64
Qt CreatorI 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! -
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.