Recording task with variable recording time

vgonet
Posts: 20
Joined: Thu Dec 13, 2018 10:01 am

Recording task with variable recording time

Postby vgonet » Tue Oct 22, 2019 9:01 am

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

jason.mao
Posts: 98
Joined: Mon Nov 19, 2018 2:05 am

Re: Recording task with variable recording time

Postby jason.mao » Mon Oct 28, 2019 6:11 am

Hi vgonet,

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

vgonet
Posts: 20
Joined: Thu Dec 13, 2018 10:01 am

Re: Recording task with variable recording time

Postby vgonet » Mon Oct 28, 2019 10:37 am

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
Attachments
codec_record.c
(21.65 KiB) Downloaded 562 times

Who is online

Users browsing this forum: No registered users and 7 guests