WaveIO {tuneR} | R Documentation |
Reading and writing Wave files.
readWave(filename, from = 1, to = Inf, units = c("samples", "seconds", "minutes", "hours"), header = FALSE) writeWave(object, filename)
filename |
Filename of the file to be read or written. |
from |
where to start reading (in order to save memory by reading wave file piecewise), in units . |
to |
where to stop reading (in order to save memory by reading wave file piecewise), in units . |
units |
units in which from and to is given, the default is “samples”,
but can be set to time intervals such as “seconds”, see the Usage Section above. |
header |
if TRUE , just header information of the Wave file are returned,
otherwise (the default) the whole Wave object. |
object |
Object of class Wave to be written to a Wave file. |
readWave
returns an object of class Wave
or a list containing just the header information if header = TRUE
.
writeWave
creates a Wave file, but returns nothing.
Uwe Ligges, ligges@statistik.tu-dortmund.de
Wobj <- sine(440, bit = 16) tdir <- tempdir() tfile <- file.path(tdir, "myWave.wav") writeWave(Wobj, filename = tfile) list.files(tdir, pattern = "\.wav$") newWobj <- readWave(tfile) newWobj file.remove(tfile)