fixwavs
fixes sound files in .wav format so they can be imported into R.
fixwavs(checksels = NULL, files = NULL, samp.rate = NULL, bit.depth = NULL,
path = NULL, mono = FALSE, sox = FALSE)
Data frame with results from checksels
. Default is NULL
. If both 'checksels' and 'files' are NULL
then all files in 'path' are converted.
Character vector with the names of the wav files to fix. Default is NULL
. If both 'checksels' and 'files' are NULL
then all files in 'path' are converted.
Numeric vector of length 1 with the sampling rate (in kHz) for output files. Default is NULL
.
(remain unchanged).
Numeric vector of length 1 with the dynamic interval (i.e. bit depth) for output files.
Default is NULL
(remain unchanged).
Character string containing the directory path where the sound files are located.
If NULL
(default) then the current working directory is used.
Logical indicating if stereo (2 channel) files should be converted to mono (1 channel). Default is NULL
(remain unchanged).
Logical indicating if SOX should be used for resampling. If TRUE
SOX must be installed. Default is FALSE
.
A folder inside the working directory (or path provided) all 'converted_sound_files', containing sound files in a format that can be imported in R.
This function aims to simplify the process of converting sound files that cannot be imported into R and/or homogenizing sound files. Problematic files can be determined using check_wavs
or check_sels
. The
check_sels
output can be directly input using the argument 'checksels'. Alternatively a vector of file
names to be "fixed" can be provided (argument 'files'). If neither of those 2 are provided the function will convert
all sound files in the working directory to the specified sample rate/bit depth. Files are saved in a new directory
('converted_sound_files'). Internally the function calls SOX. SOX must be installed to be able to run this function. If both 'checksels' and 'files' are NULL
then all files in 'path' are converted.
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.
# NOT RUN {
# Save to temporary working directory
#check this folder
getwd()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab