mirror of
https://github.com/larsimmisch/pyalsaaudio.git
synced 2026-06-20 02:12:27 +00:00
add xrun handling to the examples
it's very primitive, but it shows adequately what can happen and what to do about it minimally (that is, complain and move on).
This commit is contained in:
+3
-1
@@ -59,6 +59,8 @@ if __name__ == '__main__':
|
||||
# Read data from device
|
||||
l, data = inp.read()
|
||||
|
||||
if l:
|
||||
if l < 0:
|
||||
print("Capture buffer overrun! Continuing nonetheless ...")
|
||||
elif l:
|
||||
f.write(data)
|
||||
time.sleep(.001)
|
||||
|
||||
Reference in New Issue
Block a user