I need to store some ADC samples in the SD card using the wav file format, to get started, I’m only trying to write the header of the file and some sinewave samples, sampled at 44100 Hz, the problem is the time it takes, for the header it takes about 1 second (to write 36 bytes), for 60 seconds of samples it takes more than 1 minute (to write 10584000 bytes).
There is any way to write the wav file faster?
I need to write the wav file to the SD card with samples from the ADC almost in “real time”, using a 4 KB or 8 KB RAM buffer, due to the length of the files.
In those sketches the samples writting function is commented.
Hope someone can help me,
I’ve tried both SD.h and SdFat.h libraries and the times are similar.
recordSineWave.ino (11 KB)
recordSineWaveSdFat.ino (11.1 KB)