void play1(){
int forceCounter=0;
for(;;){
DacAudio.FillBuffer();
if(ForceWithYou.Playing==false) // if not playing,
DacAudio.Play(&ForceWithYou);
forceCounter++;
Serial.println(forceCounter);
if (forceCounter>4500)
break;
}
}
void play2(){
int fCounter=0;
for(;;){
DacAudio.FillBuffer();
if(Class.Playing==false) // if not playing,
DacAudio.Play(&Class);
fCounter++;
Serial.println(fCounter);
if (fCounter>4500)
break;
}
}
then in loop I tried to make them play one after another
void loop() {
play1();
delay (3000); // Showing that the sound will play as well as your code running here.
play2();
delay (3000);
}
but more often the 2 audios play simultaneously.
How can I clear the buffer after each portion gets played?
I have 2 files. I used two functions to play them
then in loop I tried to make them play one after another
but more often the 2 audios play simultaneously.
How can I clear the buffer after each portion gets played?