Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module for playing OGG/MP3 files using VS1053 Chip #1233

Closed
urish opened this issue Oct 3, 2018 · 13 comments
Closed

Module for playing OGG/MP3 files using VS1053 Chip #1233

urish opened this issue Oct 3, 2018 · 13 comments
Labels
Milestone

Comments

@urish
Copy link

urish commented Oct 3, 2018

Hi, I created a CircuitPython module for interfacing with the VS1053 chip (probably also works on VS1063). It allows you to play audio files through the SPI interface:

https://github.com/urish/vs1053-circuitpython

Is there any index of all community published CircuitPython modules or best practices for publishing such modules?

@ladyada
Copy link
Member

ladyada commented Oct 3, 2018

מדהים !!
you know we actually have a vs1053 driver that we never finished
would you like to see if your code and our code can work together?? :)

@urish
Copy link
Author

urish commented Oct 3, 2018

תודה :-)

I'd love to!

@ladyada
Copy link
Member

ladyada commented Oct 3, 2018

great! here's the repo, i just made it public, we started it a while ago but we didn't have a fast enough chip to really get it working - so it has languished.
please try it! if you could send any pull requests there, i could test and review it!
https://github.com/adafruit/Adafruit_CircuitPython_VS1053

@urish
Copy link
Author

urish commented Oct 3, 2018

Lovely, I booked some slot this weekend for testing it. Any specific song you would like me to test with? :-)

@ladyada
Copy link
Member

ladyada commented Oct 3, 2018

you can try any mp3 you like, just let us know what the bitrate is, because i think that will make some difference in playback. if its a public domain or creative-commons mp3 we can link to it from the guide as well.

@urish
Copy link
Author

urish commented Oct 3, 2018

Will do!

@urish
Copy link
Author

urish commented Oct 7, 2018

Update: I got the code from your repo to a working state - it plays the audio file through the VS1053, though, the playback is still choppy. I suspect that the SPIDevice wrapper is the culprint. I will do more testing this week and try to achieve similar performance to what I had with my driver.

Meanwhile, my WIP is available here:

https://github.com/urish/Adafruit_CircuitPython_VS1053

Uri

@ladyada
Copy link
Member

ladyada commented Oct 8, 2018

you may want to try: pushing more than 32 bytes of data to the VS1053 at a time, and/or only allowing a busy-loop of writes - like the function to play an mp3 just plays that mp3 in a loop rather than trying to go back to the user's script

@tannewt
Copy link
Member

tannewt commented Oct 8, 2018

When Tony ran into this issue I imagined we could add a C helper to CircuitPython that can auto-feed the SPI device on the user's behalf. I'm not sure that's what you need though. Keep in mind that adding a C helper is always an option.

@tannewt tannewt added this to the Long term milestone Oct 8, 2018
@kattni kattni modified the milestones: Long term, Libraries Mar 22, 2019
@tannewt
Copy link
Member

tannewt commented Jul 14, 2020

I'm going to close this because we now have native MP3 playback.

@tannewt tannewt closed this as completed Jul 14, 2020
@BiatuAutMiahn
Copy link

Can we have an example with MP3 playback?

@ladyada
Copy link
Member

ladyada commented Jun 28, 2022

its unlikely to work well because the buffer needs to be constantly filled - best to use native mp3 decode!

@BiatuAutMiahn
Copy link

BiatuAutMiahn commented Sep 22, 2022

I remember in another discussion that the idea was to implement something into circuitpython's c source to pull this off? For my intents, I would be using HE-AACv2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants