tests/testthat/test-read_wave.R

test_that("basic", {

  fls <- list.files(path = tempdir(), pattern = "wav$|wac$|mp3$|flac$|jpeg$|tiff$", full.names = TRUE)
  
  unlink(fls)

  data(list = c("Phae.long1"))
  writeWave(Phae.long1, file.path(tempdir(), "Phae.long1.wav"))

  # read from selection table
  wv <- read_wave(X = lbh_selec_table, index = 1, path = tempdir())

  fls <- list.files(path = tempdir(), pattern = "wav$|wac$|mp3$|flac$|jpeg$|tiff$", full.names = TRUE)
  
  unlink(fls)
    
  expect_true(is(wv, "Wave"))
  
})
maRce10/warbleR documentation built on Jan. 18, 2025, 8:31 a.m.