Skip to content

Commit

Permalink
DOC: mention how to avoid under-/overflows
Browse files Browse the repository at this point in the history
Closes #155.
  • Loading branch information
mgeier committed Jul 18, 2020
1 parent 807dd1c commit 43fe7e0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sounddevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,12 @@ def __repr__(self):
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
Expand Down Expand Up @@ -1887,8 +1893,9 @@ def input_overflow(self):
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()`).
Expand Down

0 comments on commit 43fe7e0

Please sign in to comment.