View source: R/decimateWavFiles.R
decimateWavFiles | R Documentation |
Decimate a folder of .wav files or a single .wav file to a new sample rate.
decimateWavFiles(inDir, outDir, newSr, progress = TRUE)
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 |
This code is based on R code written by Jay Barlow.
Invisibly returns the names of all files that were successfully decimated
Taiki Sakai taiki.sakai@noaa.gov
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.