summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2020-07-15 17:47:44 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2020-07-18 15:44:48 +0200
commit43fe7e0a2349f36b4b3f0a3dfcf6e92d0f931692 (patch)
tree29363c6103a155edbb1dc7a86e930cf3bfd7ff31
parent807dd1ca7473a3af99cb977584a5f7de7198769c (diff)
DOC: mention how to avoid under-/overflows
Closes #155.
-rw-r--r--sounddevice.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/sounddevice.py b/sounddevice.py
index 514bce3..233ccbd 100644
--- a/sounddevice.py
+++ b/sounddevice.py
@@ -1821,6 +1821,12 @@ class DeviceList(tuple):
class CallbackFlags(object):
"""Flag bits for the *status* argument to a stream *callback*.
+ If you experience under-/overflows, you can try to increase the
+ ``latency`` and/or ``blocksize`` settings.
+ You should also avoid anything that could block the callback
+ function for a long time, e.g. extensive computations, waiting for
+ another thread, reading/writing files, network connections, etc.
+
See Also
--------
Stream
@@ -1887,8 +1893,9 @@ class CallbackFlags(object):
In a stream opened with ``blocksize=0``, indicates that data
prior to the first sample of the input buffer was discarded due
to an overflow, possibly because the stream callback is using
- too much CPU time. Otherwise indicates that data prior to one
- or more samples in the input buffer was discarded.
+ too much CPU time. In a stream opened with a non-zero
+ *blocksize*, it indicates that data prior to one or more samples
+ in the input buffer was discarded.
This can happen in full-duplex and input-only streams (including
`playrec()` and `rec()`).