Hi,
I am tried to do recording and playback .its working in the simulator but not in the device .
so please go through my code .Please suggest me what i need to change in my code.


Qt Code:
  1. void MyTajweedScr::toggleRecord()
  2. {
  3. QString fileName;
  4. if (capture->state() == QMediaRecorder::StoppedState)
  5. {
  6.  
  7. if (!outputLocationSet)
  8. // capture->setOutputLocation(generateAudioFilePath());
  9.  
  10. // QAudioEncoderSettings settings;
  11.  
  12. QAudioEncoderSettings audioSettings;
  13.  
  14.  
  15. capture->setEncodingSettings(audioSettings);
  16. capture->setOutputLocation(QUrl::fromLocalFile(fileName));
  17. capture->record();
  18. }
  19.  
  20. else
  21. {
  22. capture->stop();
  23. }
  24. }
  25. void MyTajweedScr::setOutputLocation()
  26. {
  27. QString fileName =QFileDialog::getSaveFileName();//"E:/New folder/Project6 - Copy/IQRAV1/song/text.pcm";////;
  28. capture->setOutputLocation(QUrl(fileName));
  29. outputLocationSet = true;
  30. }
  31. void MyTajweedScr::on_Record_tb_clicked()
  32. {
  33.  
  34. setOutputLocation();
  35. toggleRecord();
  36. }
To copy to clipboard, switch view to plain text mode 


Regards,
Arpita