timelapse: Time lapse

View source: R/seewave.r

timelapseR Documentation

Time lapse

Description

Append successive input sounds into a single output sound

Usage

timelapse(dir, from = 1, to = Inf,
units = c("samples", "seconds", "minutes", "hours"), verbose = TRUE)

Arguments

dir

a character vector, the path to the directory where the .wav files are stored or directly the names of the .wav files to be appended.

from

where to start reading the input files, in units. See readWave of the package tuneR.

to

where to stop reading, in units. See readWave of the package tuneR.

units

time units in which from and to is given, the default is "samples", but can be set to time intervals such as "seconds". See readWave of the package tuneR.

verbose

a logical, if TRUE (default) the file number and name processed are displayed in the console.

Details

The function takes the .wav files which names are provided in the argument dir and append (paste) them successively so that a single object is obtained. This can be used to produce sound time lapse based on a series of ordered files as those produced by an automatic recorder (e.g. SongMeter of the society 'Wildlife Acoustics').
Only a section of each file can be extracted by using the arguments from and to. The function is based on readWave and bind of the package tuneR.

Value

A Wave object, a class defined in the package tuneR.

Note

The characteristics (sampling rate, number of bits, stereo/mono) of the output object are those of the .wav file.
The files should be alphabatically ordered according to time to ensure a proper time lapse.
You should use either savewav or writeWave to save the results as a .wav file.

Author(s)

Jérôme Sueur

See Also

pastew

Examples

## Not run: 
## if 'dir' contains a set of files recorded with a Wildlife Acoustics
# songmeter recorder then a direct way to obtain
# the spectrogram of all .wav files is
dir <- "pathway-to-directory-containing-wav-files"
res <- timelapse(dir)
# to extract a selection of each file (here a section starting
# at 10 s and ending at 12 s)
res <- timelapse(dir, from=10, to=12, unit="seconds")

## End(Not run)

seewave documentation built on Oct. 19, 2023, 5:07 p.m.

Related to timelapse in seewave...