Skip to content

Commit 43fe7e0

Browse files
committed
DOC: mention how to avoid under-/overflows
Closes #155.
1 parent 807dd1c commit 43fe7e0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sounddevice.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,12 @@ def __repr__(self):
18211821
class CallbackFlags(object):
18221822
"""Flag bits for the *status* argument to a stream *callback*.
18231823
1824+
If you experience under-/overflows, you can try to increase the
1825+
``latency`` and/or ``blocksize`` settings.
1826+
You should also avoid anything that could block the callback
1827+
function for a long time, e.g. extensive computations, waiting for
1828+
another thread, reading/writing files, network connections, etc.
1829+
18241830
See Also
18251831
--------
18261832
Stream
@@ -1887,8 +1893,9 @@ def input_overflow(self):
18871893
In a stream opened with ``blocksize=0``, indicates that data
18881894
prior to the first sample of the input buffer was discarded due
18891895
to an overflow, possibly because the stream callback is using
1890-
too much CPU time. Otherwise indicates that data prior to one
1891-
or more samples in the input buffer was discarded.
1896+
too much CPU time. In a stream opened with a non-zero
1897+
*blocksize*, it indicates that data prior to one or more samples
1898+
in the input buffer was discarded.
18921899
18931900
This can happen in full-duplex and input-only streams (including
18941901
`playrec()` and `rec()`).

0 commit comments

Comments
 (0)