@@ -2134,6 +2134,7 @@ def proc_ann_bytes(filebytes, sampto):
2134
2134
"""
2135
2135
# Base annotation fields
2136
2136
sample , label_store , subtype , chan , num , aux_note = [], [], [], [], [], []
2137
+ filebytes = filebytes .astype (np .int64 )
2137
2138
2138
2139
# Indexing Variables
2139
2140
@@ -2216,16 +2217,17 @@ def proc_core_fields(filebytes, bpi):
2216
2217
2217
2218
"""
2218
2219
sample_diff = 0
2220
+ filebytes = filebytes .astype (np .int64 )
2219
2221
2220
2222
# The current byte pair will contain either the actual d_sample + annotation store value,
2221
2223
# or 0 + SKIP.
2222
2224
while filebytes [bpi , 1 ] >> 2 == 59 :
2223
2225
# 4 bytes storing dt
2224
2226
skip_diff = (
2225
- (int ( filebytes [bpi + 1 , 0 ]) << 16 )
2226
- + (int ( filebytes [bpi + 1 , 1 ]) << 24 )
2227
- + (int ( filebytes [bpi + 2 , 0 ]) << 0 )
2228
- + (int ( filebytes [bpi + 2 , 1 ]) << 8 )
2227
+ (filebytes [bpi + 1 , 0 ] << 16 )
2228
+ + (filebytes [bpi + 1 , 1 ] << 24 )
2229
+ + (filebytes [bpi + 2 , 0 ] << 0 )
2230
+ + (filebytes [bpi + 2 , 1 ] << 8 )
2229
2231
)
2230
2232
2231
2233
# Data type is long integer (stored in two's complement). Range -2**31 to 2**31 - 1
@@ -2237,7 +2239,9 @@ def proc_core_fields(filebytes, bpi):
2237
2239
2238
2240
# Not a skip - it is the actual sample number + annotation type store value
2239
2241
label_store = filebytes [bpi , 1 ] >> 2
2240
- sample_diff += int (filebytes [bpi , 0 ] + 256 * (filebytes [bpi , 1 ] & 3 ))
2242
+ sample_diff += np .int64 (filebytes [bpi , 0 ]) + 256 * np .int64 (
2243
+ filebytes [bpi , 1 ] & 3
2244
+ )
2241
2245
bpi = bpi + 1
2242
2246
2243
2247
return sample_diff , label_store , bpi
0 commit comments