processAudio: Process audio

View source: R/io.R

processAudioR Documentation

Process audio

Description

Internal soundgen function.

Usage

processAudio(
  x,
  samplingRate = NULL,
  scale = NULL,
  from = NULL,
  to = NULL,
  funToCall,
  myPars = list(),
  var_noSummary = NULL,
  reportEvery = NULL,
  savePlots = NULL,
  saveAudio = NULL,
  cores = 1
)

Arguments

x

path to a folder, one or more wav or mp3 files c('file1.wav', 'file2.mp3'), Wave object, numeric vector, or a list of Wave objects or numeric vectors

samplingRate

sampling rate of x (only needed if x is a numeric vector)

scale

maximum possible amplitude of input used for normalization of input vector (only needed if x is a numeric vector)

from, to

if NULL (default), analyzes the whole sound, otherwise from...to (s)

funToCall

function to call (specify what to do with each audio input)

myPars

a list of parameters to pass on to 'funToCall'

var_noSummary

names of output variables that should not be summarized

reportEvery

when processing multiple inputs, report estimated time left every ... iterations (NULL = default, NA = don't report)

savePlots

full path to the folder in which to save the plots (NULL = don't save, ” = same folder as audio)

cores

number of cores for parallel processing

Examples

## Not run: 
# How many cores should I use? Maybe ~4
a1 = analyze('~/Downloads/temp60/', cores = 1)  # 3:55
a2 = analyze('~/Downloads/temp60/', cores = 2, reportEvery = 100)  # 2:30
a3 = analyze('~/Downloads/temp60/', cores = 3, reportEvery = 100)  # 1:50
a4 = analyze('~/Downloads/temp60/', cores = 4, reportEvery = 100)  # 1:33
a7 = analyze('~/Downloads/temp60/', cores = 7, reportEvery = 100)  # 1:29

## End(Not run)

soundgen documentation built on Sept. 29, 2023, 5:09 p.m.