MP3Decoder: Make it possible to start in the middle of an MP3 · csamuelson/circuitpython@cb295c5 · GitHub
Skip to content

Commit cb295c5

Browse files
committed
MP3Decoder: Make it possible to start in the middle of an MP3
You can now, e.g., ``` with open("/whatever.mp3") as mp3_file: mp3_file.seek(16000*30) decoder.file = mp3_file i2s.play(decoder) ``` to start about 30 seconds into a 128kbit/s CBR track. If a track is looped, the loop will start at the beginning. This also changes the behavior if the track is started & stopped: it will continue from where it left off, except if it had prevously run to completion. To get other behavior, you can seek the file and then re-assign the file property.
1 parent 6f6b680 commit cb295c5

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

shared-bindings/audiomp3/MP3Decoder.c

Lines changed: 12 additions & 4 deletions

shared-module/audiomp3/MP3Decoder.c

Lines changed: 1 addition & 4 deletions

0 commit comments

Comments
 (0)