Hello everyone,

I'm recording an audio file with extension(.mp3/.wav/.pcm). I'm using following code.
Qt Code:
  1. QAudioCaptureSource *audiosource = new QAudioCaptureSource(this);
  2.  
  3. QMediaRecorder *capture = new QMediaRecorder(audiosource, this);
  4.  
  5. QString fileName =QFileDialog::getSaveFileName();
  6.  
  7. capture->setOutputLocation(QUrl(fileName));
  8.  
  9. outputLocationSet = true;
  10.  
  11. capture->record();
To copy to clipboard, switch view to plain text mode 

Now, while running on simulator, it is working fine. But on device the
capture
is storing the audio file with ".amr" extension automatically and while playing back it shows that the file is corrupted.

Please check the code snippet and rectify my logic.

Thank you in advance for your support.
Satya.