Page 1 of 1

Recording task with variable recording time

Posted: Tue Oct 22, 2019 9:01 am
by vgonet
Hello,

Based on the esp-adf/examples/advanced_examples/dlna (I don't use the DLNA but I also create a FreeRTOS task as mentionned in this example), I would like to record sound in WAV format into the SPI FLASH. The recording time must be variable (user input). Is it possible to do that ?

Best regards
Vincent

Re: Recording task with variable recording time

Posted: Mon Oct 28, 2019 6:11 am
by jason.mao
Hi vgonet,

Yes. You can calculate the time as size of recoding wav data/ (sample_rate * bits * number of channel /8)

Re: Recording task with variable recording time

Posted: Mon Oct 28, 2019 10:37 am
by vgonet
Hello jason.mao

Thank you for your answer. In fact, my problem is more upstream than I described. I can't record a sound with the code I wrote.

I send you the codec.c file I've written.

The recording task is created from the function InitWAVRecorder (line 396).

The task is RunWAVRecorderTask (line 548) and I'm trying to do the same as esp-adf/examples/advanced_examples/dlna/main/audio_player.c (line 68)

The function Codec_RecordWAVFile (line 258) is called from another file to start the recording. This function takes two parameters
- the file number (used to create the file.wav, e.g: 0.wav)
- the duration in second

If you have any idea what I'm doing wrong...

Best regards,
Vincent