File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
lang/en/typeshed/stdlib/microbit Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,18 @@ def set_threshold(event: SoundEvent, value: int) -> None:
5454
5555 Example: ``microphone.set_threshold(SoundEvent.LOUD, 250)``
5656
57- A high threshold means the event will only trigger if the sound is very loud (>= 250 in the example).
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.
5866
5967 :param event: A sound event, such as ``SoundEvent.LOUD`` or ``SoundEvent.QUIET``.
60- :param value: The threshold level in the range 0-255.
68+ :param value: The threshold level in the range 0-255. Values outside this range will be clamped.
6169 """
6270 ...
6371
You can’t perform that action at this time.
0 commit comments