[Android-development] Recording a WAV file

Jason H jhihn at gmx.com
Wed Dec 11 19:29:03 CET 2019


I previously was able to use QAudioRecorder and I am pretty sure I was able to record wav (riff) files.
However I recently tried it and QAudioRecorder insists on giving me a MP4 so much so it even tacks on .mp4 to the file name I tell it to record.

I was hoping there was a way I could in Qt record a wav, because I do analysis on it and using a lossy codec is 1) not ideal 2) harder than opening a file and reading raw samples.

Does anyone know of a way to get wav?
QAudioRecorer reports . (Samsung S9 (G960U)):
 supportedContainers ("mp4", "3gp", "amr", "awb")
 supportedCodecs ("amr-nb", "amr-wb", "aac")

I was pretty sure wav used to me in that list.

I am using:
audioSettings.setSampleRate(44100);
audioSettings.setChannelCount(1);
audioSettings.setQuality(QMultimedia::HighQuality);
audioSettings.setCodec("audio/wav");

audioRecorder.setEncodingSettings(audioSettings);

Help?


More information about the Android-development mailing list