decimateWavFiles {PAMmisc} | R Documentation |
Decimate Wave Files
Description
Decimate a folder of .wav files or a single .wav file to a new sample rate.
Usage
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
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)
[Package PAMmisc version 1.12.1 Index]