Skip to content

Commit 936b172

Browse files
Suggested ammendments for set_threshold doc
1 parent f5ca4aa commit 936b172

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

lang/en/typeshed/stdlib/microbit/microphone.pyi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,16 @@ def set_threshold(event: SoundEvent, value: int) -> None:
5454
5555
Example: ``microphone.set_threshold(SoundEvent.LOUD, 250)``
5656
57-
The ``SoundEvent.LOUD`` event will be triggered when the sound level
58-
crosses this threshold upwards (from "quiet" to "loud"),
59-
and ``SoundEvent.QUIET`` event is triggered when crossing the threshold
60-
downwards (from "loud" to "quiet").
61-
62-
If the ``SoundEvent.LOUD`` value set is lower than ``SoundEvent.QUIET``,
63-
then "quiet" threshold will be decreased to one unit below the "loud"
64-
threshold. If the ``SoundEvent.QUIET`` value is set higher than
65-
``SoundEvent.LOUD``, then the "loud" threshold will be set one unit above.
57+
The ``SoundEvent.LOUD`` event is triggered when the sound level crosses the
58+
threshold from "quiet" to "loud", and the ``SoundEvent.QUIET`` event is
59+
triggered when the sound level crosses from "loud" to "quiet".
60+
61+
If the ``SoundEvent.LOUD`` threshold is set lower than the
62+
``SoundEvent.QUIET`` threshold, then the ``SoundEvent.QUIET`` threshold
63+
will decrease by one unit below the ``SoundEvent.LOUD`` threshold. If the
64+
``SoundEvent.QUIET`` threshold is set higher than the ``SoundEvent.LOUD``
65+
threshold, then the ``SoundEvent.LOUD`` threshold will increase by one unit
66+
above the ``SoundEvent.QUIET`` threshold.
6667
6768
:param event: A sound event, such as ``SoundEvent.LOUD`` or ``SoundEvent.QUIET``.
6869
:param value: The threshold level in the range 0-255. Values outside this range will be clamped.

0 commit comments

Comments
 (0)