8000 Merge pull request #6245 from jepler/document-tilegrid-8bit · domdfcoding/circuitpython@85ce161 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85ce161

Browse files
authored
Merge pull request adafruit#6245 from jepler/document-tilegrid-8bit
Document TileGrid limitation to tile values 0..255 & improve mp3 doc
2 parents 83e1b5b + c89af99 commit 85ce161

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-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
//|

shared-bindings/displayio/TileGrid.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@
5353
//| convert the value and its location to a display native pixel color. This may be a simple color
5454
//| palette lookup, a gradient, a pattern or a color transformer.
5555
//|
56+
//| To save RAM usage, tile values are only allowed in the range from 0 to 255 inclusive (single byte values).
57+
//|
5658
//| tile_width and tile_height match the height of the bitmap by default.
5759
//|
5860
//| :param Bitmap,OnDiskBitmap,Shape bitmap: The bitmap storing one or more tiles.

0 commit comments

Comments
 (0)
0