@@ -33,7 +33,7 @@ Functions
33
33
34
34
.. py :function :: current_event()
35
35
36
- Get the last recorded sound event
36
+ Get the last recorded sound event.
37
37
38
38
:return: The event, ``SoundEvent('loud') `` or ``SoundEvent('quiet') ``.
39
39
@@ -44,7 +44,7 @@ Functions
44
44
This call clears the sound history before returning.
45
45
46
46
:param event: The event to check for, such as ``SoundEvent.LOUD `` or
47
- ``SoundEvent.QUIET ``
47
+ ``SoundEvent.QUIET ``.
48
48
:return: ``True `` if sound was heard at least once since the last call,
49
49
otherwise ``False ``.
50
50
@@ -70,12 +70,20 @@ Functions
70
70
71
71
Set the threshold for a sound event.
72
72
73
- A high threshold means the event will only trigger if the sound is
74
- very loud (>= 250 in the example).
73
+ The ``SoundEvent.LOUD `` event will be triggered when the sound level
74
+ crosses this threshold upwards (from "quiet" to "loud"),
75
+ and ``SoundEvent.QUIET `` event is triggered when crossing the threshold
76
+ downwards (from "loud" to "quiet").
77
+
78
+ If the ``SoundEvent.LOUD `` value set is lower than ``SoundEvent.QUIET ``,
79
+ then "quiet" threshold will be decreased to one unit below the "loud"
80
+ threshold. If the ``SoundEvent.QUIET `` value is set higher than
81
+ ``SoundEvent.LOUD ``, then the "loud" threshold will be set one unit above.
75
82
76
83
:param event: A sound event, such as ``SoundEvent.LOUD `` or
77
84
``SoundEvent.QUIET ``.
78
- :param value: The threshold level in the range 0-255.
85
+ :param value: The threshold level in the range 0-255. Values outside this
86
+ range will be clamped.
79
87
80
88
.. py :function :: sound_level()
81
89
0 commit comments