convert_audio: convert audio file format

Description Usage Arguments Details Value

View source: R/convert_audio.R

Description

convert from mp3 and possibly other audio file formats to .wav

Usage

1
2
3
convert_audio(filein, outformat = list(filetype = "wav", res = 44100,
  mono = TRUE), overwrite = FALSE, pathout = NULL,
  pathtoffmpeg = getOption("avutils_ffmpeg"))

Arguments

filein

character, paths to input audio files

outformat

a list with specifications of the desired output format, see details

overwrite

logical, should output files be overwritten if they already exist

pathout

character, path were output is written, by default the same as the source

pathtoffmpeg

character, path to ffmpeg binary

Details

The outformat= argument currently provides three options, and by default a mono (mono = TRUE) .wav files is produced (filetpye = "wav") with 44.1kHz sampling rate (res = 441000).

Files will be potentially renamed, i.e. the file extension of the new output file will change to '.wav'.

Note that if the input file has the same name and is in the same location as the output (e.g. if you convert x.wav with pathout = NULL), nothing will happen even if you select overwrite = TRUE because ffmpeg won't overwrite its own source.

Value

a data.frame with diagnostics


gobbios/avutils documentation built on Feb. 19, 2020, 9:44 a.m.