Replies: 3 comments 7 replies
-
Thanks you for your feed-back. I think you missed to read or understand the basic fundamentals that are explained in the first chapter of the Wiki! For your question how to switch the source, I can't really give any answer because it depends on the case and usually you have many different alternatives to handle this. E.g. if you have multiple sources you could set up a copier for each and switch the copier, or you can just reconfigure the copier and define a new source and destination. The AudioKit has some defined buttons, so have a look at the AudioPlayer examples: e.g. this. The AudioActions class can be used for handling button actions. But in the end this is an Audio library and not a button handling library... |
Beta Was this translation helpful? Give feedback.
-
I reviewed that but it's not exactly what I am looking for. I don't actually want to make a music player, rather I am looking to play sounds based on other events (picture sound effects in a video game). So I don't want "previous" or "next" like the AudioPlayer delivers, but instead just play a random sound from PROGMEM preferrably. I have tried the following when events trigger:
but once they play through, the sounds won't trigger again. It's like they are at the end. I want to reset the copier and play whatever arbitrary sound is needed at that time |
Beta Was this translation helpful? Give feedback.
-
dear codegrue, do you mind sharing the full code where you use this switch (effectToPlay)... snippet in pls? i would like to change the mp3 file based on received uart strings like a dfplayer mini does. but i don't yet see how to do this in this great library. |
Beta Was this translation helpful? Give feedback.
-
I've been playing with this for a few hours and it's not obvious to me how to play another source. Actually, it's not even obvious what starts playback. Is it the copier object being created? Is it out.begin()? What if I want to play a different sound after the first completes? Or end the first mid-stream and switch to another?
I did look through most of the examples and did not see one that was switching tracks. Even the player example didn't seem to show this.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions