Reads audio clips containing sounds from events or detections
getClipData(
x,
buffer = c(0, 0.1),
mode = c("event", "detection"),
channel = 1,
useSample = FALSE,
fixLength = FALSE,
fillZeroes = TRUE,
progress = TRUE,
verbose = TRUE,
FUN = NULL,
...
)
A named list of wav clips
AcousticStudy object containing data to read wav clips for
amount before and after each event to also include in the clip, in seconds. Can either be a vector of length two specifying how much to buffer before and after (first number should be negative), or a single value if the buffer amount should be identical.
either 'event'
or 'detection'
specifying whether to create
wav clips of entire events or individual detections
channel(s) of clips to write
logical flag to use startSample information in binaries instead of UTC time for start of detections. This can be slightly more accurate (~1ms) but will take longer
logical flag to fix the output clip length to a constant value. If
TRUE
, then output clip length is entirely determined by the buffer value, as
if the detection or event had zero length. E.g. buffer=c(-2,1)
will produce clips
3 seconds long, starting 2 seconds before the detection/event start time.
logical flag to fill gaps in non-consecutive clips with zeroes. If
FALSE
, will give warnings when attempting to retrieve clips spanning non-consecutive
files and return no clip data
logical flag to show progress bar
logical flag to show summary messages
optional function to apply to wav clips. This function takes default inputs wav
,
a Wave class object, name
the name of the detection or event, time
the start and end
time of the clip, channel
as above, mode
as above, and additional args ...
optional arguments to pass to FUN
Taiki Sakai taiki.sakai@noaa.gov
data(exStudy)
recs <- system.file('extdata', 'Recordings', package='PAMpal')
exStudy <- addRecordings(exStudy, folder=recs, log=FALSE, progress=FALSE)
if (FALSE) {
# not running so that no wav clips are written to disk
wavs <- getClipData(exStudy, mode='event')
}
Run the code above in your browser using DataLab