R/SoundEnergyByMinutePython.R
SoundEnergyByMinute.py.RdThis function reads a sound file manifest in which each row contains paths to one to three sequential FLAC audio files from the same recorder and day. It uses Python's soundfile library via reticulate to extract audio samples directly from FLAC files.
SoundEnergyByMinute.py(
manifest,
flac_files,
output_dir,
start_filter = "0500",
y_limits = c(2.3, 4),
max_minutes = 180,
parallel = FALSE
)A data frame containing at least:
path — relative path to FLAC directory;
file — primary FLAC file name;
subsequent.file1, subsequent.file2 — optional FLAC files;
area, year, group, date.mmdd;
plot, startTime.hhmm.
Directory where JPEGs and CSVs will be written.
Only rows with startTime.hhmm == start_filter
are processed. Default: "0500".
Numeric vector of length 2 giving y-axis limits for plots.
Maximum number of minutes to analyze per file set.
Logical; if TRUE, rows are processed in parallel using
future.apply. You must have a plan set (e.g., future::plan()).
Root directory containing FLAC files.
Invisibly returns a data frame with columns:
area, year, group, date, plot, startTime.hhmm, minute, log10RMSE, movAvg11.
Side effects:
JPEG plots written to file.path(output_dir, "noise_jpg_all").
group–year CSVs written to output_dir.
It can run sequentially or in parallel (via future.apply) and includes basic error handling for unreadable or corrupted FLAC files.