beacon-biosignals / EDF.jl

Read and write EDF files in Julia
MIT License
18 stars 5 forks source link

Fix detection of truncated data records for BDF files #64

Closed ararslan closed 1 year ago

ararslan commented 1 year ago

Checking the number of readable records assumes 16-bit-encoded samples, i.e. an EDF file. However, when reading BDF files, which have 24-bit samples, the computed number of readable records is incorrect and the discrepancy goes unnoticed so we hit an EOFError. This can be fixed by checking the size of the sample type rather than assuming it's 2.