void playfile(char *name) { f = card.open_file(name); if (!f) { putstring_nl(" Couldn't open file"); return; } if (!wave.create(f)) { putstring_nl(" Not a valid WAV"); return; } // ok time to play! wave.play(); }
void playfile(char *name) { if (f) { card.close_file(f); } f = card.open_file(name); if (!f) { putstring(" Couldn't open file: " ); Serial.println(name); delay(500); return; } if (!wave.create(f)) { Serial.println(" Not a valid WAV"); return; } wave.play(); }