wav_2_flac | R Documentation |
wav_2_flac
converts several .wav files to .flac compressed lossless format
wav_2_flac(
files = NULL,
path = NULL,
overwrite = FALSE,
pb = TRUE,
parallel = 1,
reverse = FALSE,
compression = 5,
flac.path = ""
)
files |
character vector with the names of files to be converted. If |
path |
Character string containing the directory path where the .wav files are located.
If |
overwrite |
Logical. Control whether a .flac sound file that is already in the working directory should be overwritten. |
pb |
Logical argument to control if progress bar is shown. Default is |
parallel |
Numeric. Controls whether parallel computing is applied.
It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing). It can also be
set globally using the 'parallel' option (see |
reverse |
Logical argument to control if .wav files are converted into .flac files (default, |
compression |
Numeric string on length 1 indicating the level of compression for .flac files. Must a number between 0 (lowest) to 8 (highest compression). Default is 5. |
flac.path |
Path to the flac program, mostly needed for windows OS. |
The function will convert all .wav files in working directory or 'path' supplied to .flac format (or the opposite if reverse = TRUE
). For reading 'flac' files on windows the path to the .exe is required. This can be set using the 'flac.path' argument (or globally using the same argument in warbleR_options
). Note that reading 'flac' files requires creating a temporary copy in 'wav' format, which can be particularly slow for long files.
convert all .wav files in working directory to .flac compressed lossless format. It's just a silly wrapper over (wav2flac
) to simplify converting several files at once. The function works recursively, converting files within all subfolders.
.flac files saved in the working directory with same name as original wav files.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
## Not run:
# create some .wav files
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4"))
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"))
# Convert all files to .flac format
wav_2_flac(path = tempdir())
# check this folder!!
open_wd(tempdir())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.