how to do recording and playback in the device ?
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.
Code:
void MyTajweedScr::toggleRecord()
{
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
Re: how to do recording and playback in the device ?
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?"