Applies a Butterworth high-pass (default 250 Hz, 48 dB/octave) with FFmpeg
and writes filtered copies (WAV or FLAC) to paths$filtered, mirroring the
folder structure and file names of paths$audio_standardized. Originals
are never modified.
Details
Resumable: completed files are recorded in metadata/02_filter.done
only after the output has been written and verified (readable, same
duration, sample rate and channels). Per-file outcomes, including FFmpeg
error text, are appended to metadata/02_filter_results.csv. Only files
with qc_pass == TRUE are filtered. Format (WAV vs FLAC) is preserved from
source files. Run with pam_run_stage("02_filter", pam_filter_audio, cfg).
Examples
# \donttest{
if (nzchar(Sys.which("ffmpeg"))) {
ex <- pam_example_project()
# the later stages read the master table that the scan builds
res <- suppressMessages(pam_scan_audio(ex$cfg))
out <- suppressMessages(pam_filter_audio(ex$cfg))
out$n_ok
basename(list.files(ex$cfg$paths$filtered, recursive = TRUE))
}
#> [1] "G0059_20260405_183000.wav" "G0059_20260405_183002.wav"
#> [3] "G0059_20260405_183004.wav" "G0110_20260406_060000.wav"
#> [5] "G0110_20260406_060002.wav" "G0110_20260406_060004.wav"
# }
