clip_wave_single {ARUtools}R Documentation

Clip single wave file

Description

Clip and copy a single wave files to a given length. See clip_wave() for processing multiple files.

Usage

clip_wave_single(
  path_in,
  path_out,
  clip_length,
  start_time = 0,
  wave_length = NULL,
  overwrite = FALSE
)

Arguments

path_in

Character. Path to the wave file to clip.

path_out

Character. Path to copy the new clipped wave file to.

clip_length

Numeric. Length of new clip in seconds.

start_time

Numeric. Time in seconds where new clip should start. Default 0.

wave_length

Numeric. Length of the clipped wave file in seconds (if NULL, default, will be the length of time from start_time to the end of the file).

overwrite

Logical. Whether to overwrite existing files when creating new clipped wave files. Default (FALSE) will error if the file already exists.

Value

TRUE if successful

Examples

# Create test wave file
f <- temp_wavs(1)

# Clip file and check it out
clip_wave_single(f, "new_file.wav", clip_length = 1)
tuneR::readWave("new_file.wav")
unlink("new_file.wav")

[Package ARUtools version 0.6.2 Index]