tidy_audio_dir: Tidy MP3 or Wave

Description Usage Arguments Details Value Examples

View source: R/data_prep.R

Description

Apply transformations for modelling ready audio files.

Usage

1
2
3
4
5
6
7
tidy_audio_dir(
  audio_files,
  dest_dir = tempdir(),
  sample_rate = 16000,
  bits = 16,
  parallel = 1
)

Arguments

audio_files

character vector with the full path for the mp3 files.

dest_dir

optional atomic character indicating the path where to store the files. Default is a tempdir(). Set NULL if you want the dest dir be the same as origin (warning: it will overwrite the original wave files!)

sample_rate

integer. Sample rate.

bits

integer.

Details

The transformations are:

- mp3 to wav - normalization - stereo to mono

Value

a character vector of the same size of audio_files with the file names of the transformed wavs.

Examples

1
2
3
4
mp3_dir <- system.file("mp3_sample", package = "mestrado")
mp3_files <- list.files(mp3_dir, full.names = TRUE)

wav_files <- tidy_audio(mp3_files)

Athospd/mestrado documentation built on Jan. 2, 2021, 3:59 a.m.