This function scans a directory of .flac sound files and creates a manifest with metadata including file size, duration, time stamps (parsed from file names), plot/group identifiers, and MD5 checksums. It assumes a file naming convention where: Date-time stamp starts 20 characters from the end of the filename. Group ID = first 4 characters of the filename. Plot ID = characters 5–8 of the filename.Files are in chronological order.

CreateManifest(
  input_dir,
  output_dir,
  year = as.integer(format(Sys.Date(), "%Y")),
  location = "",
  technician = "",
  recorderType = "SwiftOne",
  output_prefix = "soundManifest_",
  export = c("csv", "object")
)

Arguments

input_dir

Character. Path to the directory containing `.flac` files named as SITEID_YYYYMMDD_HHHHHH.flac

output_dir

Character. Path where the manifest CSV will be saved.

year

Integer. Year of recording (default = current year).

location

Character. Area, site or prefix (default = `""`).

technician

Character. Name/ID of technician.

recorderType

Character. Recorder type (default = `"SwiftOne"`).

output_prefix

Character. Prefix for the output file (default = `"soundManifest_"`).

export

Select whether to export as csv file in your output_dir or to the global environment object.

Value

A data frame with one row per sound file and the following columns:

  • path – relative directory of file

  • file – file name

  • subsequent.file1, subsequent.file2 – possible subsequent files

  • FileSize.MB, FileType, recorderType, area, group, plot

  • plot.alias, recorder, recorderAlias, extraAttrib1, extraAttrib2

  • year, technician, date.mmdd, startTime.hhmm,

  • startTime.Excel, startTime.yyyymmddhhmm, fileLength.min

  • MD5_checksum

Examples

if (FALSE) { # \dontrun{
CreateManifest(
  input_dir = "G:/HB",
  output_dir = "C:/output",
  year = 2023,
  location = "Habitat",
  technician = "ASW"
)
head(manifest)
} # }