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()
{
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();
}
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();
}
To copy to clipboard, switch view to plain text mode
Regards,
Arpita
Bookmarks