decimateWavFiles: Decimate Wave Files

Description Usage Arguments Details Value Author(s) Examples

View source: R/decimateWavFiles.R

Description

Decimate a folder of .wav files or a single .wav file to a new sample rate.

Usage

1
decimateWavFiles(inDir, outDir, newSr, progress = TRUE)

Arguments

inDir

directory of wave files to decimate. Can also be a single .wav file.

outDir

directory to write wave files to

newSr

sample rate to decimate the files to

progress

logical flag to show progress bar

Details

This code is based on R code written by Jay Barlow.

Value

Invisibly returns the names of all files that were successfully decimated

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples

1
2
3
4
5
6
7
origDir <- file.path(tempdir(), 'origSR')
decDir <- file.path(tempdir(), 'decSR')
writeClickWave('origWav.wav', outDir=origDir, signalLength = 1, clickLength = 100,
               clicksPerSecond = 200, frequency = 20000, sampleRate = 100000)
decWavs <- decimateWavFiles(origDir, decDir, 50000)
file.remove(paste0(origDir, 'origWav.wav'))
file.remove(decWavs)

PAMmisc documentation built on Oct. 8, 2021, 9:08 a.m.