extract_events: Extract detected events and writes them to a sound file

View source: R/extract_events.R

extract_eventsR Documentation

Extract detected events and writes them to a sound file

Description

Uses audacity marks, either obtained from text file created with seewave::write.audacity or an object of class threshold_detection to extract audio events from the original sound file. Optional arguments allow to resample and coerce stereo to mono before writing wav to file.

Usage

extract_events(
  threshold_detection,
  buffer = 1,
  format = c("WAV", "wav", "mp3", "MP3"),
  path,
  downsample = NULL,
  mono = TRUE,
  rescale = NULL,
  LPF = NULL,
  HPF = NULL
)

Arguments

threshold_detection

either class threshold_detection or path to audacity marks

buffer

Buffer in seconds added to before and after the event (default 1). Controls also the detection of overlapping events.

format

Format of sound files (default and suggested is to use WAV).

path

where to look up the sound file

downsample

Null or re-sampling factor used in split_wave (default NULL).

mono

Logical. By default, split_wave coerces stereo files to mono prior to event detection (default TRUE). If kept as stereo file the left channel will used in find_events.

rescale

optional. allows to resacale the wav to a new bit rate (e.g., "8", "16", "24").

LPF

integer. Low-Pass Filter (Hz). Frequencies above the cutoff are greatly attenuated. Default is set internally at the Nyquist frequency of the recording.

HPF

integer. High-Pass Filter (Hz). Frequencies below the cutoff are greatly attenuated. Default setting is 16000 Hz. A default of 1000 Hz is recommended for most bird vocalizations.

Value

data frame


mottensmann/NocMigR documentation built on Oct. 3, 2023, 3:36 a.m.