// check if playback is still going on
Query the number of frames/samples in the wave file
waveFile.frames();
The number of frames/samples in the wave file
// create a SDWaveFile
waveFile = SDWaveFile(filename);
// check if the WaveFile is valid
if (!waveFile) {
Serial.println("wave file is invalid!");
while (1); // do nothing
}
//.
long frames = waveFile.frames();
Serial.print("Frames = ");
Serial.println(frames);