hi
i am new in qt and try to use this code to save a audio in file,it s nokia example but i have a problem , when i want to do this nothing happened.
in line outputFile.setFileName("Ohter\mm\mm\mm\mm\mm\mm\mm\mm\mm\mm\test.raw"); i could not build a file or folder but when i check tst it is true,
what is problem do you think?
void MainWindow::startRecord()
{
ui->lResult->setText("Start Record");
outputFile.setFileName("Ohter\mm\mm\mm\mm\mm\mm\mm\mm\mm\mm\test.raw");
bool tst = outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate );
if(tst)
ui->lResult->setText("true");
QAudioFormat format;
// set up the format you want, eg.
format.setFrequency(8000);
format.setChannels(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
if (!info.isFormatSupported(format))
{
format = info.nearestFormat(format);
ui->lResult->setText("format does not compatible");
}
audio = new QAudioInput(format, this);
QTimer::singleShot(3000, this, SLOT(stopRecording()));
audio->start(&outputFile);
ui->lResult->setText("Timer has been started!");
}
void MainWindow:: stopRecording()
{
audio->stop();
outputFile.close();
delete audio;
ui->lResult->setText("Stop Record");
}



