Last chance! 50% off unlimited learning
Sale ends in
info_sound_files
is a wrapper for selection_table
that returns sound file information
info_sound_files(path = NULL, files = NULL, parallel = 1, pb = TRUE, skip.error = FALSE,
file.format = "\.wav$|\.wac$|\.mp3$|\.flac$")
A data frame with descriptive information about the sound files in the working directory (or 'path'). See "details".
Character string containing the directory path where the sound files are located.
If NULL
(default) then the current working directory is used.
character vector indicating the set of files that will be consolidated. File names should not include the full file path. Optional.
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing).
Logical argument to control progress bar and messages. Default is TRUE
.
Logical to control if errors are omitted. If so, files that could not be read will be excluded and their name printed in the console. Default is FALSE
, which will return an error if some files are problematic.
Character string with the format of sound files. By default all sound file formats supported by warbleR are included ("\.wav$|\.wac$|\.mp3$|\.flac$"). Note that several formats can be included using regular expression syntax as in grep
. For instance "\\.wav$|\\.mp3$"
will only include .wav and .mp3 files.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
This function is a wrapper for selection_table
that returns a data frame with the following descriptive parameters for each sound file in the working directory (or 'path'):
duration
: duration of selection in seconds
sample.rate
: sampling rate in kHz
channels
: number of channels
bits
: bit depth
wav.size
: sound file size in MB
samples
: number of samples in the sound file
Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: An R package to streamline analysis of animal acoustic signals. Methods in Ecology and Evolution, 8(2), 184-191.
fix_wavs
, selection_table
& check_sels
{
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
writeWave(Phae.long1, file.path(tempdir(), "Phae.long1.wav"))
writeWave(Phae.long2, file.path(tempdir(), "Phae.long2.wav"))
writeWave(Phae.long3, file.path(tempdir(), "Phae.long3.wav"))
writeWave(Phae.long4, file.path(tempdir(), "Phae.long4.wav"))
#get info
info_sound_files(path = tempdir())
}
Run the code above in your browser using DataLab