Per-window RMS curve of an audio file
Description
Runs one ffmpeg astats pass over file and returns the RMS level
of each fixed-size window. Quieter windows (more-negative dB) mark pauses, so
the curve is a cheap way to find good places to cut. About 140x realtime.
Usage
rms_curve(file, window = 1024L)
Arguments
file: Path to an audio (or audio-bearing video) file.window: Window size in samples (default 1024; ~64ms at 16kHz). Smaller windows give finer time resolution at more rows.
Value
A list with numeric time (window centre, seconds) and
rms (RMS level in dB; digital silence is -120). Empty vectors if the
pass produced nothing.
Examples
cur <- rms_curve("speech.mp3")
plot(cur$time, cur$rms, type = "l") # dips are pauses