Merge pull request #2 from kanapoutz78/patch-2
Fix overflow bug for Raspberry Pi
This commit is contained in:
commit
977f9a0df4
@ -16,8 +16,9 @@ def start_stream(callback):
|
||||
prev_ovf_time = time.time()
|
||||
while True:
|
||||
try:
|
||||
y = np.fromstring(stream.read(frames_per_buffer), dtype=np.int16)
|
||||
y = np.fromstring(stream.read(frames_per_buffer, exception_on_overflow=False), dtype=np.int16)
|
||||
y = y.astype(np.float32)
|
||||
stream.read(get_read_available(), exception_on_overflow=False)
|
||||
callback(y)
|
||||
except IOError:
|
||||
overflows += 1
|
||||
|
Loading…
Reference in New Issue
Block a user