@@ -74,6 +74,8 @@ def record(duration: int = 3000, rate: int = 7812) -> AudioFrame:
7474 """Record sound into an ``AudioFrame`` for the amount of time indicated by
7575 ``duration`` at the sampling rate indicated by ``rate``.
7676
77+ Example: ``my_frame = microphone.record()``
78+
7779 The amount of memory consumed is directly related to the length of the
7880 recording and the sampling rate. The higher these values, the more memory
7981 it will use.
@@ -93,6 +95,8 @@ def record_into(buffer: AudioFrame, rate: int = 7812, wait: bool = True) -> None
9395 """Record sound into an existing ``AudioFrame`` until it is filled,
9496 or the ``stop_recording()`` function is called.
9597
98+ Example: ``microphone.record_into()``
99+
96100 :param buffer: An ``AudioFrame`` to record sound.
97101 :param rate: Number of samples to capture per second.
98102 :param wait: When set to ``True`` it blocks until the recording is
@@ -103,13 +107,16 @@ def record_into(buffer: AudioFrame, rate: int = 7812, wait: bool = True) -> None
103107def is_recording () -> bool :
104108 """Checks whether the microphone is currently recording.
105109
106- :return: ``True`` if the microphone is currently recording sound, or
107- ``False`` otherwise.
110+ Example: ``is_recording = microphone.is_recording()``
111+
112+ :return: ``True`` if the microphone is currently recording sound, otherwise returns ``False``.
108113 """
109114 ...
110115
111116def stop_recording () -> None :
112117 """Stops a recording running in the background.
118+
119+ Example: ``microphone.stop_recording()``
113120 """
114121 ...
115122
@@ -126,6 +133,8 @@ SENSITIVITY_HIGH: float;
126133def set_sensitivity (gain : float ) -> None :
127134 """Configure the microphone sensitivity.
128135
136+ Example: ``microphone.set_sensitivity(microphone.SENSITIVITY_HIGH)``
137+
129138 The default sensitivity is ``microphone.SENSITIVITY_MEDIUM``.
130139
131140 :param gain: The microphone gain. Use ``microphone.SENSITIVITY_LOW``, ``microphone.SENSITIVITY_MEDIUM``, ``microphone.SENSITIVITY_HIGH``, or a value between these levels.
0 commit comments