I understood that if I don't define the file size in the beginning, then I can't use offset option, right?
Correct, yes. However if you were to write the raw buffer from the Uint16Array I guess you know its size? 3 buffers of 2*SAMPLES bytes?
But if you're planning on writing CSV maybe check out StorageFile - that provides a file that you can keep appending to (but it's text only, not binary): https://www.espruino.com/Reference#StorageFile
The problem with writing CSV is you have to be able to load it back in - if you do str.split(",") that's going to create a huge array of numbers anyway, which is pretty much the same as using JSON.parse
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Correct, yes. However if you were to write the raw buffer from the Uint16Array I guess you know its size? 3 buffers of 2*SAMPLES bytes?
But if you're planning on writing CSV maybe check out StorageFile - that provides a file that you can keep appending to (but it's text only, not binary): https://www.espruino.com/Reference#StorageFile
The problem with writing CSV is you have to be able to load it back in - if you do
str.split(",")
that's going to create a huge array of numbers anyway, which is pretty much the same as using JSON.parse