soundgen (version 1.5.0)

spectrogramFolder: Save spectrograms per folder

Description

Creates spectrograms of all wav/mp3 files in a folder and saves them as .png files in the same folder. This is a lot faster than running analyzeFolder if you don't need pitch tracking. By default it also creates an html file with a list of audio files and their spectrograms in the same folder. If you open it in a browser that supports playing .wav and/or .mp3 files (e.g. Firefox or Chrome), you can view the spetrograms and click on them to play each sound. Unlike analyzeFolder, spectrogramFolder supports plotting both a spectrogram and an oscillogram if osc = TRUE.

Usage

spectrogramFolder(myfolder, htmlPlots = TRUE, verbose = TRUE,
  windowLength = 50, step = NULL, overlap = 50, wn = "gaussian",
  zp = 0, ylim = NULL, osc = TRUE, xlab = "Time, ms",
  ylab = "kHz", width = 900, height = 500, units = "px",
  res = NA, ...)

Arguments

myfolder

full path to the folder containing wav/mp3 files

htmlPlots

if TRUE, saves an html file with clickable plots

verbose

if TRUE, reports progress and estimated time left

windowLength

length of FFT window, ms

step

you can override overlap by specifying FFT step, ms

overlap

overlap between successive FFT frames, %

wn

window type: gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop

zp

window length after zero padding, points

ylim

frequency range to plot, kHz (defaults to 0 to Nyquist frequency)

osc

should an oscillogram be shown under the spectrogram? TRUE/ FALSE. If `osc_dB`, the oscillogram is displayed on a dB scale. See osc_dB for details

xlab

graphical parameters

ylab

graphical parameters

width

parameters passed to png if the plot is saved

height

parameters passed to png if the plot is saved

units

parameters passed to png if the plot is saved

res

parameters passed to png if the plot is saved

...

other parameters passed to spectrogram

Examples

Run this code
# NOT RUN {
spectrogramFolder(
  '~/Downloads/temp',
  windowLength = 40, overlap = 75,  # spectrogram pars
  width = 1500, height = 900,        # passed to png()
  osc = TRUE, osc_dB = TRUE, heights = c(1, 1)
)
# note that the folder now also contains an html file with clickable plots
# }

Run the code above in your browser using DataLab