[R] reducing the sampling rate of a .wav file

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Wed Oct 22 21:57:26 CEST 2014


I've read in a wav file using 'tuneR':

silence<-readWave("silence0.5sec.wav")

I run summary(silence):

Wave Object
Number of Samples:      22051
Duration (seconds):     0.5
Samplingrate (Hertz):   44100
Channels (Mono/Stereo): Mono
PCM (integer format):   TRUE
Bit (8/16/24/32/64):    16

Summary statistics for channel(s):

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
      0       0       0       0       0       0


I would like to save this file as a lower frequency file so that:
Samplingrate (Hertz):   8000

Is it possible?
I am trying:
savewav(silence,filename="silence0.5sec 8000.wav",f=800)

But it doesn't work - it saves the file but when I read it in,
Samplingrate is still 44100

-- 
Dimitri Liakhovitski



More information about the R-help mailing list