title: Saving recording to MP3 container in Qt
body: <p>I am programming on the Windows 7 platform using Qt 4.8.4, Qt Mobility 1.2 and C++. I am attempting to record audio from the front jack and save it to a file in mp3 format. I have the program working with the LAME encoder, but the file is being saved as WAV.</p>
  
  <p>It appears that I have no control over the container type, which is defaulting to PCM/WAV.</p>
  
  <p>Here are the QAudioEncoderSettings I am using:</p>
  
  <pre><code>QAudioEncoderSettings settings;
  settings.setCodec("audio/mpeg");
  settings.setSampleRate(boxValue(ui-&gt;sampleRateBox).toInt());
  settings.setBitRate(boxValue(ui-&gt;bitrateBox).toInt());
  settings.setQuality(QtMultimediaKit::EncodingQuality(ui-&gt;qualitySlider-&gt;value()));
  settings.setEncodingMode(ui-&gt;constantQualityRadioButton-&gt;isChecked() ?
                           QtMultimediaKit::ConstantQualityEncoding :
                           QtMultimediaKit::ConstantBitRateEncoding);
  
  QString container = "audio/x-mp3";
  
  capture-&gt;setEncodingSettings(settings, QVideoEncoderSettings(), container);
  </code></pre>
  
  <p>A post recording conversion is not an option, as the files may become quite large, and the probability that the process would be ended before the conversion was complete is quite high.</p>
  
  <p>Thank you for any help provided.</p>