Skip to content

Commit f4c9898

Browse files
Add microphone sound_level_db doc
1 parent 7057837 commit f4c9898

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,23 @@ def set_threshold(event: SoundEvent, value: int) -> None:
7171
...
7272

7373
def sound_level() -> int:
74-
"""Get the sound pressure level.
74+
"""Get the sound pressure level in the range 0 to 255.
7575
7676
Example: ``microphone.sound_level()``
7777
7878
:return: A representation of the sound pressure level in the range 0 to 255.
7979
"""
8080
...
8181

82+
def sound_level_db() -> int:
83+
"""Get the sound pressure level in decibels.
84+
85+
Example: ``microphone.sound_level_db()``
86+
87+
:return: A representation of the sound pressure level in decibels (dB).
88+
"""
89+
...
90+
8291
def record(duration: int, rate: int = 7812) -> AudioFrame:
8392
"""Record sound into an ``AudioFrame`` for the amount of time indicated by
8493
``duration`` at the sampling rate indicated by ``rate``.

0 commit comments

Comments
 (0)