Hi everyone,
I am trying to collect the data from the Sony Spresence digital microphone. It works well when I collect data using the ‘recording’ example. However, I can not record anything in the Live classification stage.
Is that due to edge impulse use of the analog microphone to record only?
if (theAudio->getRecordingSize() > recoding_size)*
{*
theAudio->stopRecorder();*
sleep(1);*
err = theAudio->readFrames(myFile);*
goto exitRecording;*
}*
/* Read frames to record in file /
err = theAudio->readFrames(myFile);*
if (err != AUDIOLIB_ECODE_OK)*
{*
printf("File End! =%d\n",err);*
theAudio->stopRecorder();*
goto exitRecording;*
}*
if (ErrEnd)*
{*
printf("Error End\n");*
theAudio->stopRecorder();*
goto exitRecording;*
}*
return;*
exitRecording:
theAudio->closeOutputFile(myFile);*
myFile.close();*
theAudio->setReadyMode();*
theAudio->end();*
puts(“End Recording”);*
//exit(1);*
delay(100);*
Serial.println(“>>> Start USB Mass Storage Operation”);*
// Start USB Mass Storage*
if (theSD.beginUsbMsc()) {*
Serial.println(“UsbMsc connect error”);*
}*
Serial.println(“Finish USB MSC? (y/n)”);*
while (true) {*
while (!Serial.available());*
if(Serial.read() == ‘y’){*
while (Serial.available()) {*
Serial.read(); // dummy read to empty input buffer*
}*
break;*
}*
}*
// Finish USB Mass Storage*
if (theSD.endUsbMsc()) {*
Serial.println(“UsbMsc disconnect error”);*
}*
Serial.println(“<<< Finish USB Mass Storage Operation”);*
delay(100);*
exit(1);* }
I also added one line to record in edge-impulse example, like this:
static bool microphone_inference_record(void) {
uint32_t length;
err_t err;
/*
RingBuff* ringbuf_fft[m_channel];
int16_t *samples = ringbuf_fft[1];
*/
int16_t *samples = (int16_t *)s_buffer;