a patch for @sampler stability + speaker idle noise malfunction issue

+ just don't give it message w/ note == 0. that breaks audio loop. and 
don't reach actual player.stop()
This commit is contained in:
Dooho Yi 2021-10-08 08:32:53 +09:00
parent 149b21e64a
commit 1daa4a5868

View file

@ -112,6 +112,11 @@ void sample_player_start() {
delay(10);
}
void sample_player_stop() {
//if note == 0, just stop immediately w/o checking
// + and this way of checking is not nice (AudioNoInterrupts + test + AudioInterrupts)
// what if sound files list could be generated @ setup time and later just react on that list?
// i think that way is much more stable than stopping interrupts. (-> breaks audio engine sometimes.)
if (note != 0) {
//filename buffer - 8.3 naming convension! 8+1+3+1 = 13
char filename[13] = "NNN.WAV";
//search for the sound file
@ -130,6 +135,7 @@ void sample_player_stop() {
Serial.println("... does not exist.");
return;
}
}
//stop the player.
if (playSdWav1.isPlaying() == true) {
playSdWav1.stop();