Description Usage Arguments Details Value Examples
Finds syllables and bursts in all .wav files in a folder.
1 2 3 4 5 | segmentFolder(myfolder, shortestSyl = 40, shortestPause = 40,
sylThres = 0.9, interburst = NULL, interburstMult = 1,
burstThres = 0.075, peakToTrough = 3, troughLeft = TRUE,
troughRight = FALSE, windowLength = 40, overlap = 80, summary = TRUE,
plot = FALSE, savePath = NA, verbose = TRUE, reportEvery = 10, ...)
|
myfolder |
full path to target folder |
shortestSyl |
minimum acceptable length of syllables, ms |
shortestPause |
minimum acceptable break between syllables, ms.
Syllables separated by less time are merged. To avoid merging, specify
|
sylThres |
amplitude threshold for syllable detection (as a proportion of global mean amplitude of smoothed envelope) |
interburst |
minimum time between two consecutive bursts (ms). If
specified, it overrides |
interburstMult |
multiplier of the default minimum interburst
interval (median syllable length or, if no syllables are detected, the same
number as |
burstThres |
to qualify as a burst, a local maximum has to be at least
|
peakToTrough |
to qualify as a burst, a local maximum has to be at
least |
troughLeft |
should local maxima be compared to the trough on the left and/or right of it? Default to TRUE and FALSE, respectively |
troughRight |
should local maxima be compared to the trough on the left and/or right of it? Default to TRUE and FALSE, respectively |
windowLength |
length (ms) and overlap (
window used to produce the amplitude envelope, see
|
overlap |
length (ms) and overlap (
window used to produce the amplitude envelope, see
|
summary |
if TRUE, returns only a summary of the number and spacing of syllables and vocal bursts. If FALSE, returns a list containing full stats on each syllable and bursts (location, duration, amplitude, ...) |
plot |
if TRUE, produces a segmentation plot |
savePath |
full path to the folder in which to save the plots. Defaults to NA |
verbose, reportEvery |
if TRUE, reports progress every |
... |
other graphical parameters passed to |
This is just a convenient wrapper for segment
intended for
analyzing the syllables and bursts in a large number of audio files at a
time. In verbose mode, it also reports ETA every ten iterations. With default
settings, running time should be about a second per minute of audio.
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 | ## Not run:
# download 260 sounds from Anikin & Persson (2017)
# http://cogsci.se/personal/results/
# 01_anikin-persson_2016_naturalistics-non-linguistic-vocalizations/260sounds_wav.zip
# unzip them into a folder, say '~/Downloads/temp'
myfolder = '~/Downloads/temp' # 260 .wav files live here
s = segmentFolder(myfolder, verbose = TRUE)
# Check accuracy: import a manual count of syllables (our "key")
key = segmentManual # a vector of 260 integers
trial = as.numeric(s$nBursts)
cor(key, trial, use = 'pairwise.complete.obs')
boxplot(trial ~ as.integer(key), xlab='key')
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.