Commit cf62283
authored
Hotfix bdf recording (#445)
* change depricated function
* Flush EDF buffer at quarter-second intervals
Reduce the threshold for writing EDF samples from _fs to _fs // 4 so buffered data is flushed more frequently. Previously the FileRecorder only wrote when the buffer exceeded one second of samples; this change triggers writes at roughly quarter-second increments to lower memory usage and latency while retaining the existing behavior of writing full _fs-sized chunks and updating annotations/timestamps under the same lock.
* Write full-second sample blocks to file
Replace the previous arbitrary threshold write logic with computation of whole-second sample blocks: compute num_samples_to_write as (n_samples // fs) * fs and only write when > 0. This ensures written chunks are multiples of the sampling frequency, avoids partial-frame writes and potential timestamp/data misalignment, and then drops the written samples from the buffer.1 parent b3aec16 commit cf62283
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
367 | 368 | | |
368 | | - | |
| 369 | + | |
369 | 370 | | |
370 | 371 | | |
371 | 372 | | |
| |||
0 commit comments