ArduinoSound - SDWaveFile.currentTime()

Description

Query the current position of playback of the wave file

Syntax

waveFile.currentTime();

Returns

The current playback position of the wave file in seconds

SDWaveFile.cue()`

Description

Change the playback position of the wave file

Syntax

waveFile.cue(time);

Parameters

time: time is seconds to change playback to

Returns

1 on is the playback position was cued successfully, 0 on failure

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
  }

  /// play the file using an audio output ...

  // jump back to 10 second into the wave file
  waveFile.cue(10);