savewav {seewave}R Documentation

Save .wav file

Description

Save sound data as .wav file

Usage

savewav(wave, f,
filename = NULL)

Arguments

wave a vector, a matrix (first column), an object of class ts, Sample (left channel), or Wave (left channel).
f sampling frequency of wave (in Hz). Does not need to be specified if wave is an object of class ts, Sample, or Wave.
filename name of the new file. (by default the name of wave).

Details

This function uses two functions from the package sound: Sample and saveSample

Note

The file automatically owerwrites an existing file with the same name.

Author(s)

Jerome Sueur sueur@mnhn.fr

See Also

as.Sample, saveSample, export.

Examples

a<-synth(f=8000,d=2,cf=2000,plot=FALSE)
# the name of the file is automatically the name of the object
# here: "a.wav"
savewav(a,f=22050)
unlink("a.wav")
# if you wish to change the name, use 'file' argument
savewav(a,f=22050,file="b.wav")
unlink("b.wav")

[Package seewave version 1.5.4 Index]