Learn R Programming

soundgen (version 2.5.1)

processAudio: 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

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

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

summaryFun

function(s) used to summarize the output per input

Examples

Run this code
if (FALSE) {
# 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
}

Run the code above in your browser using DataLab