Learn R Programming

warbleR (version 1.1.8)

mp32wav: Convert .mp3 files to .wav

Description

mp32wav converts several .mp3 files in working directory to .wav format

Usage

mp32wav(samp.rate = 44.1, parallel = 1, from.path = NULL, to.path = NULL, 
normalize = NULL, pb = TRUE)

Arguments

samp.rate

Sampling rate at which the .wav files should be written. The maximum permitted is 44.1 kHz (default). Units should be kHz.

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). Not availble in Windows OS.

from.path

Character string containing the directory path where the .mp3 files are located. If NULL (default) then the current working directory is used.

to.path

Character string containing the directory path where the .wav files will be saved. If NULL (default) then the current working directory is used.

normalize

Character string containing the units to be used for amplitude normalization. Check (normalize) for details. If NULL (default) no normalization is carried out.

pb

Logical argument to control progress bar. Default is TRUE. Note that progress bar is only used when parallel = 1.

Value

.wav files saved in the working directory with same name as original mp3 files.

Details

convert all .mp3 files in working directory to .wav format. Function used internally to read .mp3 files (readMP3) sometimes crashes.

Examples

Run this code
# NOT RUN {
# First set temporary folder
setwd(tempdir())
 
#Then download mp3 files from xeno-canto
querxc(qword = "Phaethornis aethopygus", download = TRUE)

# Convert all files to .wav format
mp32wav()

#check this folder!!
getwd()
# }

Run the code above in your browser using DataLab