I'm using QAudioRecorder in Qt to record a voice, here is the sample code.
audioRecorder = new QAudioRecorder;
QAudioEncoderSettings audioSettings;
audioSettings.setCodec("audio/amr"); //here's my question
audioSettings.setQuality(QMultimedia::HighQuality);
audioRecorder->setEncodingSettings(audioSettings);
audioRecorder->setOutputLocation(QUrl::fromLocalFile("test.amr"));
audioRecorder->record();
But I have no idea how to use the setCodec() function
void QAudioEncoderSettings::setCodec(const QString & codec)
How can find out which parameter (such as "audio/amr"
or "audio/x-wav"
) I can use and their exact meanings? Thanks!
You could see the codec candidate in the source code for the different plugins.