ArduinoSound - SDWaveFile.frames()

// check if playback is still going on

Description

Query the number of frames/samples in the wave file

Syntax

waveFile.frames();

Returns

The number of frames/samples in the wave file

Example


// 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);