Skip to content

Play different SFX for each button. Using LittleFS, MP3 , I2S and RP2040 #1242

Answered by pschatzmann
djairjr asked this question in Q&A
Discussion options

You must be logged in to vote

To detect button press events you can use a pin interupt with (attachInterrupt) or you can use my AudioActions class. I don't have any plain vanilla example but only some AudioKit ones is using this class. This example also shows how to define the file to play.

If you don't want to play the next song automatically: the player has a method setAutoNext(): just set it to false
If you need more control on what is played you can implement your own AudioSourceCallback

However I would build the solution as follows:

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pschatzmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants