PDA

View Full Version : how to do recording and playback in the device ?



kumari arpita
2nd August 2012, 11:22
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.





void MyTajweedScr::toggleRecord()
{
QString fileName;
if (capture->state() == QMediaRecorder::StoppedState)
{

if (!outputLocationSet)
// capture->setOutputLocation(generateAudioFilePath());

// QAudioEncoderSettings settings;

QAudioEncoderSettings audioSettings;


capture->setEncodingSettings(audioSettings);
capture->setOutputLocation(QUrl::fromLocalFile(fileName));
capture->record();
}

else
{
capture->stop();
}
}
void MyTajweedScr::setOutputLocation()
{
QString fileName =QFileDialog::getSaveFileName();//"E:/New folder/Project6 - Copy/IQRAV1/song/text.pcm";////;
capture->setOutputLocation(QUrl(fileName));
outputLocationSet = true;
}
void MyTajweedScr::on_Record_tb_clicked()
{

setOutputLocation();
toggleRecord();
}



Regards,
Arpita

ChrisW67
2nd August 2012, 23:26
How about you tell us which bit fails and how it fails?

Commenting out lines 8 and 10 changes the entire function of the if() at line 7. Is this really the code that is "working in the simulator?"