Voice recording encoding problem



  • Hello everyone.
    The problem that i'm facing is that i record a voice message but the encoding of the record is mp4. I would like to use different encoding for my record. Is there a way to do that?What about if i want to save it like mp3 file?


  • Moderators

    @NickV You should tell how you are recording.
    If you use QAudioRecorder then take a look at its documentation: http://doc.qt.io/qt-5/qaudiorecorder.html
    Did you try to set codec via QAudioEncoderSettings?
    There is even an example how to do it:

    recorder = new QMediaRecorder(camera);
    
    QAudioEncoderSettings audioSettings;
    audioSettings.setCodec("audio/amr");
    audioSettings.setQuality(QMultimedia::HighQuality);
    
    recorder->setAudioSettings(audioSettings);
    
    recorder->setOutputLocation(QUrl::fromLocalFile(fileName));
    recorder->record();
    


  • You've already asked this question:
    Audio recording

    Depending on what device you are using to record the audio, you may be limited to your available codecs. AFAIK, Qt does not provide codecs, just an interface to access them. You'd have to encode in a format native to your hardware and convert after the fact, or find a third-party codec you can integrate with your application and post-process the recorded audio after the fact.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.