circuitpython/shared-bindings
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
..
_bleio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
_eve circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
_pew Merge pull request #5466 from jepler/merge-1.17 2021-10-15 23:34:31 -04:00
_stage circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
adafruit_bus_device Fix busdevice stub path 2021-12-28 19:31:40 +11:00
adafruit_pixelbuf circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
aesio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
alarm Fix recording of wake_alarm 2021-12-21 21:48:36 -05:00
analogio Merge tag 'v1.17' into merge-1.17 2021-10-15 08:20:54 -05:00
atexit Convert more modules to use MP_REGISTER_MODULE 2021-08-25 20:48:55 -04:00
audiobusio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
audiocore circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
audioio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
audiomixer circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
audiomp3 audiomp3: add decoded_samples property 2022-01-01 23:28:43 -06:00
audiopwmio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
bitbangio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
bitmaptools bitmaptools: add missing types 2021-12-22 11:16:38 -06:00
bitops Fix n_args_min on many MP_DEFINE_CONST_FUN_OBJ_KW() 2021-10-07 16:55:19 -04:00
board Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
busio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
camera camera: Update camera_make_new arguments 2021-11-17 16:42:47 +01:00
canio Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
circuitpython_typing circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
countio countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
digitalio countio: add selectable rise and fall detection, pulls 2021-12-31 16:34:58 -05:00
displayio Merge pull request #5760 from jepler/rename_under_typing 2021-12-22 14:05:04 -08:00
dualbank Convert more modules to use MP_REGISTER_MODULE 2021-09-01 00:19:05 -04:00
fontio Provide a protocol for `Font`s 2021-12-27 10:31:35 -06:00
framebufferio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
frequencyio Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
gamepadshift Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
getpass Convert more modules to use MP_REGISTER_MODULE 2021-08-26 21:35:02 -04:00
gifio gifio: Add dithered output 2021-10-27 10:54:31 -05:00
gnss Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
i2cperipheral circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
imagecapture Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
ipaddress Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
is31fl3741 Renaming files 2021-11-23 17:21:13 -06:00
keypad Clear TAMPER interrupt properly; make keypad module table const 2021-12-12 22:00:08 -05:00
math Convert more modules to use MP_REGISTER_MODULE 2021-08-26 21:35:02 -04:00
memorymonitor Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
microcontroller Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
msgpack circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
multiterminal run code formatting script 2021-03-15 19:27:36 +05:30
neopixel_write circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
nvm boot counter using existing nvm object 2021-09-10 13:43:04 -06:00
onewireio Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
os Additional missing-prototypes fixes 2021-11-10 10:55:53 -06:00
paralleldisplay Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
ps2io Rename make_new's parameter to `all_args` 2021-10-15 13:49:33 -05:00
pulseio Update D13 to LED, add PWM example. 2021-10-28 13:30:51 -04:00
pwmio Update D13 to LED, add PWM example. 2021-10-28 13:30:51 -04:00
qrio Merge tag 'v1.17' into merge-1.17 2021-10-15 08:20:54 -05:00
rainbowio rainbowio: No need for the ternary here 2021-11-12 17:31:15 -06:00
random Convert more modules to use MP_REGISTER_MODULE 2021-08-30 22:29:51 -04:00
rgbmatrix Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
rotaryio rotaryio: Add the ability to set the divisor 2021-10-16 09:43:45 -05:00
rtc spresense: Fix time.time() 2021-11-30 12:38:48 +01:00
sdcardio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
sdioio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
sharpdisplay Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
socketpool Fix _bleio.start_advertising arg check; add doc to SocketPool.socket() 2021-10-25 08:43:57 -04:00
ssl Add methods to ssl.SSLContext for handling self-signed certs 2021-12-14 01:00:50 +00:00
storage Additional missing-prototypes fixes 2021-11-10 10:55:53 -06:00
struct Convert more modules to use MP_REGISTER_MODULE 2021-08-30 22:29:51 -04:00
supervisor Initial broadcom port for Raspberry Pi 2021-11-22 14:54:44 -08:00
synthio circuitpython_stubs: Use `circuitpython_typing` for cp-specific typing 2021-12-22 11:14:21 -06:00
terminalio Merge pull request #5466 from jepler/merge-1.17 2021-10-15 23:34:31 -04:00
time Additional missing-prototypes fixes 2021-11-10 10:55:53 -06:00
touchio Merge tag 'v1.17' into merge-1.17 2021-10-15 08:20:54 -05:00
traceback traceback: fix for crash on non-native exceptions 2021-12-15 12:29:21 +05:30
uheap Convert more modules to use MP_REGISTER_MODULE 2021-09-01 00:19:05 -04:00
usb_cdc Convert more modules to use MP_REGISTER_MODULE 2021-08-30 22:29:51 -04:00
usb_hid touch up doc 2021-10-18 16:26:12 -04:00
usb_midi Convert more modules to use MP_REGISTER_MODULE 2021-08-30 22:29:51 -04:00
ustack Convert more modules to use MP_REGISTER_MODULE 2021-09-01 00:19:05 -04:00
vectorio vectorio contains(x, y) 2021-12-27 12:01:19 -10:00
watchdog samd51: Add watchdog timer 2021-10-19 10:52:14 -05:00
wifi like #5571, but for AP 2021-11-16 12:21:50 -06:00
help.rst Apply a Sphinx transform to make the core module docs look better 2020-08-07 00:01:31 +09:00
index.rst docs: Improve 5.0.x <-> main branch doc linkrot 2020-06-14 11:12:35 -05:00
support_matrix.rst Merge MicroPython 1.13 into CircuitPython 2021-05-04 18:06:33 -07:00
util.c Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
util.h Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00