Skip to content

Commit a201f4a

Browse files
mgeierlarsoner
authored andcommitted
DOC: add documentation for common parameters
1 parent fdbdbb6 commit a201f4a

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

doc/api.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ API Documentation
1111
MixerAndRecorder
1212
RingBuffer
1313

14+
Common parameters that are shared by most commands:
15+
16+
``start``
17+
Desired time at which the playback/recording should be started.
18+
The actual time will be stored in the ``actual_time`` field of the
19+
returned action.
20+
21+
``time``
22+
Desired time at which the command should be executed.
23+
The actual time will be stored in the ``actual_time`` field of the
24+
returned action.
25+
26+
``allow_belated``
27+
Use ``False`` to cancel the command in case the requested time cannot be met.
28+
The ``actual_time`` field will be set to ``0.0`` in this case.
29+
Use ``True`` to execute the command nevertheless.
30+
Even if the requested time was met, the ``actual_time`` might be slightly
31+
different due to rounding.
32+
33+
All commands return a corresponding "action", which can be compared against the
34+
active `actions`, and can be used as input for `cancel()` and `wait()`.
35+
36+
1437
.. autoclass:: Mixer
1538
:members: play_buffer, play_ringbuffer, actions, cancel, wait, stats,
1639
fetch_and_reset_stats

src/rtmixer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __init__(self, **kwargs):
162162
def play_buffer(self, buffer, channels, start=0, allow_belated=True):
163163
"""Send a buffer to the callback to be played back.
164164

165-
After that, the *buffer* must not be written to anymore.
165+
After calling this, the *buffer* must not be written to anymore.
166166

167167
"""
168168
channels, mapping = self._check_channels(channels, 'output')

0 commit comments

Comments
 (0)