@@ -72,6 +72,13 @@ Functions
7272
7373 Stops all audio playback.
7474
75+ .. py :function :: sound_level()
76+
77+ Get the sound pressure level produced by audio currently being played.
78+
79+ :return: A representation of the output sound pressure level in the
80+ range 0 to 255.
81+
7582
7683Built-in sounds **V2 **
7784======================
@@ -251,11 +258,15 @@ AudioFrame
251258 During playback, increasing the sampling rate speeds up the sound
252259 and decreasing it slows it down.
253260
261+ :param sample_rate: The sample rate to set.
262+
254263 .. py :function :: get_rate()
255264
256265 (**V2 only **) Return the configured sampling rate for this
257266 ``AudioFrame `` instance.
258267
268+ :return: The configured sample rate.
269+
259270 .. py :function :: copyfrom(other)
260271
261272 Overwrite the data in this ``AudioFrame `` with the data from another
@@ -272,12 +283,13 @@ Technical Details
272283
273284The ``audio.play() `` function can consume an instance or iterable
274285(sequence, like list or tuple, or generator) of ``AudioFrame `` instances,
275- The ``AudioFrame `` default playback rate is 7812 Hz, and the output is a
276- a PWM signal at 32.5 kHz.
286+ The ``AudioFrame `` default playback rate is 7812 Hz, and can be configured
287+ at any point with the ``AudioFrame.set_rate() `` method.
288+ The ``AudioFrame.set_rate() `` also works while the ``AudioFrame `` is being
289+ played, which will affect the playback speed.
277290
278291Each ``AudioFrame `` instance is 32 samples by default, but it can be
279- configured to a different size via constructor and the
280- ``AudioFrame.set_rate() `` method.
292+ configured to a different size via constructor parameters.
281293
282294So, for example, playing 32 samples at 7812 Hz takes just over 4 milliseconds
283295(1/7812.5 * 32 = 0.004096 = 4096 microseconds).
0 commit comments