Go to file
Ben Combee 98b0029a29 audiomp3: add decoded_samples property
In my testing, there is no way to accurately know how far into a MP3 file
you're currently playing. You can use monotonic time, but that can have
drift versus the audio playback system, which may not be running at exactly
the expected sample rate.

To allow syncing animation with timestamps in a MP3 file, this presents a
new property, decoded_samples, that records the number of audio samples
sent out of the decoder. While this may not be a completely accurate time,
due to mixer delays, it's much better position that the monotonic clock
difference.

Implementation is keeping track of this value in the mp3file structure and
adding to it whenever data is sent out of the decoder. The property
implementation was a copy/paste from current properties in the audiomp3
files.
2022-01-01 23:28:43 -06:00
.github Revert "Fix cascadetoml more" 2021-12-22 10:07:30 -08:00
LICENSES Add an explicit SPDX license file for ter-u12n. 2020-07-06 19:15:41 +01:00
data update nvm.toml module to latest 2021-11-04 08:56:14 -06:00
devices/ble_hci restore BLEIO HCI background task 2021-12-07 22:39:17 -05:00
docs update sphinx 2021-12-22 11:32:54 -06:00
examples Merge tag 'v1.17' into merge-1.17 2021-10-15 08:20:54 -05:00
extmod Update ulab 2021-12-17 08:28:49 -06:00
frozen update frozen libraries for 7.1.x 2021-12-24 08:21:24 -05:00
lib Update protomatter & re-enable rgbmatrix on esp32s2 2021-12-17 12:04:39 -06:00
locale Update translation files 2022-01-01 05:46:11 +01:00
logo Add license to some obvious files. 2020-07-06 19:16:25 +01:00
mpy-cross fix name of windows mpy-cross executable 2021-10-15 08:53:58 -05:00
ports Merge pull request #5803 from dhalbert/countio-enhancements 2021-12-31 23:45:59 -05:00
py countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
shared Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
shared-bindings audiomp3: add decoded_samples property 2022-01-01 23:28:43 -06:00
shared-module audiomp3: add decoded_samples property 2022-01-01 23:28:43 -06:00
supervisor address review comments 2021-12-27 19:36:11 -05:00
tests countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
tools Don't freeze utils directories 2021-12-29 11:56:30 +11:00
.git-blame-ignore-revs top: Update .git-blame-ignore-revs for latest formatting commit. 2021-04-27 23:46:46 +10:00
.gitattributes Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
.gitignore refine stubs-building procedure 2021-06-22 08:59:05 -05:00
.gitmodules Merge pull request #5615 from microDev1/espressif 2021-12-03 14:55:05 -05:00
.mailmap Add a `.mailmap` file to collate together multiple author entries. 2020-07-06 19:15:41 +01:00
.pre-commit-config.yaml Add neopixel support on PWM capable pins 2021-12-14 16:59:53 -08:00
.readthedocs.yml update sphinx 2021-12-22 11:32:54 -06:00
.rosie.yml Add license to some obvious files. 2020-07-06 19:16:25 +01:00
ACKNOWLEDGEMENTS Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
ACKNOWLEDGEMENTS.license Add license to some obvious files. 2020-07-06 19:16:25 +01:00
BUILDING.md install is a pre-commit command 2021-12-15 13:05:03 -07:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md from source-of-truth repository. 2020-06-03 10:43:36 +01:00
CONTRIBUTING.md Fix error 2020-10-26 23:36:54 +01:00
LICENSE LICENSE: Update for move of crypto-algorithms, re1.5, uzlib to lib. 2021-07-12 16:36:40 +10:00
MANIFEST.in-stubs refine stubs-building procedure 2021-06-22 08:59:05 -05:00
Makefile Ignore failure of first command. It's deliberate 2021-11-29 16:25:15 -08:00
README.rst add esp32s3 documentation in readme 2021-12-03 21:20:55 +05:30
README.rst-stubs Actually reduce the README text for the stubs package 2021-06-24 13:41:01 -05:00
WEBUSB_README.md Rename esp32s2 port to espressif 2021-09-13 16:44:55 -07:00
conf.py Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
license.rst Improve docs and update to CircuitPython. 2017-01-05 16:20:46 -08:00
main.c address review comments 2021-12-27 19:36:11 -05:00
requirements-ci.txt build docs dynamically 2021-09-16 00:05:42 +05:30
requirements-dev.txt Revert "pin specific versions of cascadetoml & tomlkit, temporarily" 2021-12-21 11:17:10 -08:00
requirements-doc.txt Merge pull request #5759 from jepler/font-protocol 2021-12-28 10:36:24 -05:00
setup.py-stubs refine stubs-building procedure 2021-06-22 08:59:05 -05:00

README.rst-stubs

CircuitPython
=============

.. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png

|Build Status| |Doc Status| |License| |Discord| |Weblate|

`circuitpython.org <https://circuitpython.org>`__ \| `Get CircuitPython <#get-circuitpython>`__ \|
`Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \|
`Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \|
`Project Structure <#project-structure>`__

**CircuitPython** is a *beginner friendly*, open source version of Python for tiny, inexpensive
computers called microcontrollers.

This package contains the "stubs", or type definitions for CircuitPython.  With some advanced
editors and other tools, this information can be identify TypeErrors, AttributeErrors, and other
problems before you deploy your code to a device and can even help autocomplete your code.

.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg
   :target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain
.. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest
   :target: http://circuitpython.readthedocs.io/
.. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg
   :target: https://adafru.it/discord
.. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg
   :target: https://choosealicense.com/licenses/mit/
.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg
   :target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget