Help talk:Contents/zh

Jump to: navigation, search

About this board

2001:DA8:219:308:AD89:EE11:AE08:B5DB (talkcontribs)

void MainWindow::on_recordButton_clicked()

{

    outputFile.setFileName("/home/ubuntu/recognition/build-TibetainRec-Desktop-Debug/"+timeStr+".raw");

    outputFile.open( QIODevice::WriteOnly|QIODevice :: Truncate);

    inputFile.setFileName("/home/ubuntu/recognition/build-TibetainRec-Desktop_Qt_5_7_0_GCC_64bit-Debug/"+timeStr+".raw");

    QAudioFormat format;

    // set up the format you want, eg.

    format.setSampleRate(16000);

    format.setChannelCount(1);

    format.setSampleSize(16);

    format.setCodec("audio/pcm");

    format.setByteOrder(QAudioFormat::LittleEndian);  //QAudioFormat::BigEndian

    format.setSampleType(QAudioFormat::SignedInt);  //QAudioFormat::SignedInt

    QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();

    if (!info.isFormatSupported(format)) {

        qWarning()<<"default format not supported try to use nearest";

        format = info.nearestFormat(format);

     }

//     outputFile.open( QIODevice::ReadWrite | QIODevice::Truncate );

     audioIn = new QAudioInput(format, this);

     //QTimer::singleShot(3000, this, SLOT(stopRecording()));

     audioIn->start(&outputFile);// Records audio for 3000ms

     /*output = tr("");

     ui->textEdit->setText(output);

     cmd->start("arecord -t wav -c 1 -f S16_LE -r 16000 -d  8 -V mono test.wav");*/

     ui->textEdit->setText("");

     ui->textEdit->setText("record begin!");

}

Reply to "device not open"

What params do I can set to the peripheral device(CC254x), and let it advert with a random address?

1
Buleurchin (talkcontribs)

see the topic.

Reply to "What params do I can set to the peripheral device(CC254x), and let it advert with a random address?"
There are no older topics