esp32_SoundRecorder icon indicating copy to clipboard operation
esp32_SoundRecorder copied to clipboard

const int waveDataSize = record_time * 88000;

Open MichaelVLV opened this issue 6 years ago • 6 comments

Hello,

What is meaning this constants at .ino file 88000 and 8000?

const int waveDataSize = record_time * 88000;
const int numCommunicationData = 8000;

Is it somehow belongs to sample rate 44100 Hz @ 16bits?

MichaelVLV avatar Jun 13 '18 12:06 MichaelVLV

Hi,

how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

aarotronics avatar Mar 25 '19 18:03 aarotronics

Hey, I tested it and he made a typo. I think its supposed to be 44100 * 16 * 1 / 8 (44100 hz, 16 bit and 1 channel), 88200.

If I record with 88000 my files get ever so slighty shorter.

SinanAkkoyun avatar Jun 12 '20 21:06 SinanAkkoyun

Hi,

how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

SinanAkkoyun avatar Jun 12 '20 21:06 SinanAkkoyun

Hi, how can I do to record for ever? I mean, in code I can se that the WAV file header depends on the record time and I want to get it recording until I press a buton or something like that.

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

Then you have to change the for loop to a while(button not pressed)

SinanAkkoyun avatar Jun 12 '20 21:06 SinanAkkoyun

Hey, thats what I want to accomplish as well. Simply put, just write zeros at the header file size, write all audio to your file and after the final button press, get the file size with (fseek(file, 0, SEEK_END);) int size = ftell(file);, seek to the position of the size in header, I think that would be fseek(file, 4, SEEK_SET); and then write all 4 chars to the size you just measured as in the header file specified.

Hi Brother, I read it and implement this in my code but I am getting some errors. So can you please add this feature to your code and then finally send me the code with this feature added in it.

IPARTH10 avatar Jun 25 '20 13:06 IPARTH10

44100 * 16 * 1 / 8

Hey, what does the '8' represents ?

nicorenaldo avatar May 27 '21 20:05 nicorenaldo