Description Usage Arguments Value Examples
Acoustic analysis of all .wav files in a folder. See analyze
and vignette('acoustic_analysis', package = 'soundgen') for further details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  analyzeFolder(myfolder, htmlPlots = TRUE, verbose = TRUE,
samplingRate = NULL, dynamicRange = 80, silence = 0.04,
SPL_measured = 70, Pref = 20, windowLength = 50, step = NULL,
overlap = 50, wn = "gaussian", zp = 0, cutFreq = 6000,
nFormants = 3, pitchMethods = c("autocor", "spec", "dom"),
entropyThres = 0.6, pitchFloor = 75, pitchCeiling = 3500,
priorMean = HzToSemitones(300), priorSD = 6, priorPlot = FALSE,
nCands = 1, minVoicedCands = "autom", domThres = 0.1,
domSmooth = 220, autocorThres = 0.7, autocorSmooth = NULL,
cepThres = 0.3, cepSmooth = NULL, cepZp = 0, specThres = 0.3,
specPeak = 0.35, specSinglePeakCert = 0.4, specHNRslope = 0.8,
specSmooth = 150, specMerge = 1, shortestSyl = 20,
shortestPause = 60, interpolWin = 3, interpolTol = 0.3,
interpolCert = 0.3, pathfinding = c("none", "fast", "slow")[2],
annealPars = list(maxit = 5000, temp = 1000), certWeight = 0.5,
snakeStep = 0.05, snakePlot = FALSE, smooth = 1,
smoothVars = c("pitch", "dom"), summary = TRUE,
summaryStats = c("mean", "median", "sd"), plot = FALSE,
showLegend = TRUE, savePlots = FALSE, plotSpec = TRUE,
pitchPlot = list(col = rgb(0, 0, 1, 0.75), lwd = 3),
candPlot = list(levels = c("autocor", "spec", "dom", "cep"), col =
c("green", "red", "orange", "violet"), pch = c(16, 2, 3, 7), cex = 2),
ylim = NULL, xlab = "Time, ms", ylab = "kHz", main = NULL,
width = 900, height = 500, units = "px", res = NA, ...)

myfolder 
full path to target folder 
htmlPlots 
if TRUE, saves an html file with clickable plots 
verbose 
if TRUE, reports progress and estimated time left 
samplingRate 
sampling rate of 
dynamicRange 
dynamic range, dB. All values more than one dynamicRange under maximum are treated as zero 
silence 
(0 to 1) frames with RMS amplitude below silence threshold are not analyzed at all. NB: this number is dynamically updated: the actual silence threshold may be higher depending on the quietest frame, but it will never be lower than this specified number. 
SPL_measured 
sound pressure level at which the sound is presented, dB 
Pref 
reference pressure, Pa 
windowLength 
length of FFT window, ms 
step 
you can override 
overlap 
overlap between successive FFT frames, % 
wn 
window type: gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop 
zp 
window length after zero padding, points 
cutFreq 
(>0 to Nyquist, Hz) repeat the calculation of spectral
descriptives after discarding all info above 
nFormants 
the number of formants to extract per FFT frame. Calls

pitchMethods 
methods of pitch estimation to consider for determining pitch contour: 'autocor' = autocorrelation (~PRAAT), 'cep' = cepstral, 'spec' = spectral (~BaNa), 'dom' = lowest dominant frequency band 
entropyThres 
pitch tracking is not performed for frames with Weiner
entropy above 
pitchFloor 
absolute bounds for pitch candidates (Hz) 
pitchCeiling 
absolute bounds for pitch candidates (Hz) 
priorMean 
specifies the mean and sd of gamma distribution
describing our prior knowledge about the most likely pitch values for this
file. Specified in semitones: 
priorSD 
specifies the mean and sd of gamma distribution
describing our prior knowledge about the most likely pitch values for this
file. Specified in semitones: 
priorPlot 
if TRUE, produces a separate plot of the prior 
nCands 
maximum number of pitch candidates per method (except for

minVoicedCands 
minimum number of pitch candidates that
have to be defined to consider a frame voiced (defaults to 2 if 
domThres 
(0 to 1) to find the lowest dominant frequency band, we do shortterm FFT and take the lowest frequency with amplitude at least domThres 
domSmooth 
the width of smoothing interval (Hz) for finding

autocorThres 
(0 to 1) separate voicing thresholds for detecting pitch candidates with three different methods: autocorrelation, cepstrum, and BaNa algorithm (see Details). Note that HNR is calculated even for unvoiced frames. 
autocorSmooth 
the width of smoothing interval (in bins) for finding peaks in the autocorrelation function. Defaults to 7 for sampling rate 44100 and smaller odd numbers for lower values of sampling rate 
cepThres 
(0 to 1) separate voicing thresholds for detecting pitch candidates with three different methods: autocorrelation, cepstrum, and BaNa algorithm (see Details). Note that HNR is calculated even for unvoiced frames. 
cepSmooth 
the width of smoothing interval (in bins) for finding peaks in the cepstrum. Defaults to 31 for sampling rate 44100 and smaller odd numbers for lower values of sampling rate 
cepZp 
zeropadding of the spectrum used for cepstral pitch detection (final length of spectrum after zeropadding in points, e.g. 2 ^ 13) 
specThres 
(0 to 1) separate voicing thresholds for detecting pitch candidates with three different methods: autocorrelation, cepstrum, and BaNa algorithm (see Details). Note that HNR is calculated even for unvoiced frames. 
specPeak 
when looking for putative harmonics in
the spectrum, the threshold for peak detection is calculated as

specSinglePeakCert 
(0 to 1) if F0 is calculated based on a single
harmonic ratio (as opposed to several ratios converging on the same
candidate), its certainty is taken to be 
specHNRslope 
when looking for putative harmonics in
the spectrum, the threshold for peak detection is calculated as

specSmooth 
the width of window for detecting peaks in the spectrum, Hz 
specMerge 
pitch candidates within 
shortestSyl 
the smallest length of a voiced segment (ms) that constitutes a voiced syllable (shorter segments will be replaced by NA, as if unvoiced) 
shortestPause 
the smallest gap between voiced syllables (ms) that means they shouldn't be merged into one voiced syllable 
interpolWin 
control the behavior of
interpolation algorithm when postprocessing pitch candidates. To turn off
interpolation, set 
interpolTol 
control the behavior of
interpolation algorithm when postprocessing pitch candidates. To turn off
interpolation, set 
interpolCert 
control the behavior of
interpolation algorithm when postprocessing pitch candidates. To turn off
interpolation, set 
pathfinding 
method of finding the optimal path through pitch
candidates: 'none' = best candidate per frame, 'fast' = simple heuristic,
'slow' = annealing. See 
annealPars 
a list of control parameters for postprocessing of
pitch contour with SANN algorithm of 
certWeight 
(0 to 1) in pitch postprocessing, specifies how much we prioritize the certainty of pitch candidates vs. pitch jumps / the internal tension of the resulting pitch curve 
snakeStep 
optimized path through pitch candidates is further
processed to minimize the elastic force acting on pitch contour. To
disable, set 
snakePlot 
if TRUE, plots the snake 
smooth 
if 
smoothVars 
if 
summary 
if TRUE, returns only a summary of the measured acoustic variables (mean, median and SD). If FALSE, returns a list containing framebyframe values 
summaryStats 
a vector of names of functions used to summarize each acoustic characteristic 
plot 
if TRUE, produces a spectrogram with pitch contour overlaid 
showLegend 
if TRUE, adds a legend with pitch tracking methods 
savePlots 
if TRUE, saves plots as .png files 
plotSpec 
if 
pitchPlot 
a list of graphical parameters for displaying the final
pitch contour. Set to 
candPlot 
a list of graphical parameters for displaying
individual pitch candidates. Set to 
ylim 
frequency range to plot, kHz (defaults to 0 to Nyquist frequency) 
xlab 
plotting parameters 
ylab 
plotting parameters 
main 
plotting parameters 
width 
parameters passed to

height 
parameters passed to

units 
parameters passed to

res 
parameters passed to

... 
other graphical parameters passed to 
If summary
is TRUE, returns a dataframe with one row per audio
file. If summary
is FALSE, returns a list of detailed descriptives.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ## Not run:
# download 260 sounds from Anikin & Persson (2017)
# http://cogsci.se/personal/results/
# 01_anikinpersson_2016_naturalisticsnonlinguisticvocalizations/260sounds_wav.zip
# unzip them into a folder, say '~/Downloads/temp'
myfolder = '~/Downloads/temp' # 260 .wav files live here
s = analyzeFolder(myfolder, verbose = TRUE) # ~ 1530 minutes!
# Save spectrograms with pitch contours plus an html file for easy access
a = analyzeFolder('~/Downloads/temp', savePlots = TRUE,
showLegend = TRUE,
width = 20, height = 12,
units = 'cm', res = 300)
# Check accuracy: import manually verified pitch values (our "key")
key = pitchManual # a vector of 260 floats
trial = s$pitch_median
cor(key, trial, use = 'pairwise.complete.obs')
plot(log(key), log(trial))
abline(a=0, b=1, col='red')
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.