This function reads a sound manifest, converts FLAC files to WAV using the external `sox` utility, concatenates sequential audio files, computes per-minute log10(RMSE) values, applies an 11-minute rolling average, generates diagnostic plots, and writes grouped CSV outputs.

SoundEnergyByMinute(
  manifest_file,
  manifest_sheet = "soundManifest",
  flac_root,
  output_dir,
  temp_dir = tempdir(),
  start_time = 500,
  y_limits = c(2.3, 4)
)

Arguments

manifest_file

A data frame containing the initial sound manifest created by CreateManifest(), including at least the columns fileLength.min, startTime.hhmm, group, plot, date.mmdd, area, and year.

manifest_sheet

Sheet name in the manifest file.

flac_root

Root directory containing FLAC audio files.

output_dir

Directory for CSV and JPG outputs.

temp_dir

Temporary directory for WAV conversion.

start_time

Filter manifest rows by `startTime.hhmm`.

y_limits

Numeric vector of length 2 giving y-axis limits for plots.

Value

A data frame containing minute-level noise metrics for all files.

Details

Requires the external program **SoX** to be installed and available on the system PATH. Each FLAC file is temporarily converted to WAV before analysis.

Output includes:

  • Per-minute log10(RMSE)

  • 11-minute rolling mean

  • JPG plots of noise time series

  • Grouped CSV files by group × year