Skip to contents

Get the length of a recording in seconds

Usage

get_wav_length(path, return_numeric = FALSE)

Arguments

path

Character. Path to wave file.

return_numeric

Logical. Return numeric or character?

Value

Length of recording in seconds

Examples

  f <- tempfile()
  w <- tuneR::sine(440, duration = 100000)
  tuneR::writeWave(w, f)
  get_wav_length(f)
#> 2.27 seconds