Skip to content

Commit c89af99

Browse files
committed
Advise about ways to improve mp3 playback
Closes: #6133
1 parent d24f3b8 commit c89af99

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

shared-bindings/audiomp3/MP3Decoder.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@
4444
//| :param typing.BinaryIO file: Already opened mp3 file
4545
//| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file.
4646
//|
47+
//| Playback of mp3 audio is CPU intensive, and the
48+
//| exact limit depends on many factors such as the particular
49+
//| microcontroller, SD card or flash performance, and other
50+
//| code in use such as displayio. If playback is garbled,
51+
//| skips, or plays as static, first try using a "simpler" mp3:
52+
//|
53+
//| * Use constant bit rate (CBR) not VBR or ABR (variable or average bit rate) when encoding your mp3 file
54+
//| * Use a lower sample rate (e.g., 11.025kHz instead of 48kHz)
55+
//| * Use a lower bit rate (e.g., 32kbit/s instead of 256kbit/s)
56+
//|
57+
//| Reduce activity taking place at the same time as
58+
//| mp3 playback. For instance, only update small portions of a
59+
//| displayio screen if audio is playing. Disable auto-refresh
60+
//| and explicitly call refresh.
4761
//|
4862
//| Playing a mp3 file from flash::
4963
//|

0 commit comments

Comments
 (0)