Cannot get setIndex to work #999
-
Hello and thank you very much for this great library. I'm having difficulty getting I'm trying to use an ESP32 with an SD card and HiLetgo PCM5102 DAC to create a programmable car horn. I have a set of 4 buttons (red, green, yellow, blue) that will play an MP3 horn sound when pressed. I also have different folders on the SD card, each with four MP3 files. Thus, the user can also use up/down buttons to choose a different folder with four different horn sounds which will then be assigned to the four colored buttons. I've gotten the sounds to play and I can change folder paths. However, no matter what button gets pressed, it always plays the first file in the folder. Here's the function that changes the index and calls the
This set of functions looks for button presses and calls the
Again, no matter which button is pressed, the first file (index 0) gets played. Here's the output of the logs:
As you can see, it seems to initially select stream 1, but then ends up playing stream 0. You can also see that I've tried using the Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I suggest that you have a look at the begin method of the AudioPlayer in the class documentation. Then you should be able to figure out yourself what's happening! |
Beta Was this translation helpful? Give feedback.
I suggest that you have a look at the begin method of the AudioPlayer in the class documentation. Then you should be able to figure out yourself what's happening!