You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this nice library and so far it works good. I still have a few things, though.
In my application, I sometimes want to start a track to play from SD card. Let's say the startup sound. It plays for about 5 seconds, during the setup() and I would like to fade some LEDs while the sound is playing.
void setup() {
.
.
.
playSoundAndWait();
fadeRGB(); //takes about as long as the sound.
.
.
.
}
void playSoundAndWait()
{
audio.connecttoFS(SD, "/welcome.mp3");
while (audio.isRunning())
{
audio.loop();
}
}
So far it works with the only downside that the sound is played, and after it is finished the LEDs start. Well, that's obvious since it is caught in the while. Unfortunately, I did not get it to work properly in the background. I previously used the DFPlayermini and there was a method like Player.start("welcome.mp3") and it ran somehow in the background or let's say in parallel to my LEDs.
Maybe you have a hint @schreibfaul1 on how to achieve that.
I basically need two functions:
the first one should wait until the selected track is finished. See playSoundAndWait()
the other one should just start the track and move on in the code
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone,
I came across this nice library and so far it works good. I still have a few things, though.
In my application, I sometimes want to start a track to play from SD card. Let's say the startup sound. It plays for about 5 seconds, during the
setup()
and I would like to fade some LEDs while the sound is playing.So far it works with the only downside that the sound is played, and after it is finished the LEDs start. Well, that's obvious since it is caught in the
while
. Unfortunately, I did not get it to work properly in the background. I previously used theDFPlayermini
and there was a method likePlayer.start("welcome.mp3")
and it ran somehow in the background or let's say in parallel to my LEDs.Maybe you have a hint @schreibfaul1 on how to achieve that.
I basically need two functions:
playSoundAndWait()
Thanks and all the best
Beta Was this translation helpful? Give feedback.
All reactions