Reading Wave files.
readWave(filename, from = 1, to = Inf,
units = c("samples", "seconds", "minutes", "hours"), header = FALSE, toWaveMC = NULL)
An object of class Wave
or WaveMC
or a list containing just the header information if header = TRUE
.
If the latter, some experimental support for reading bext
chunks in
Broadcast Wave Format files is implemented, and the content is returned as an unprocessed string (character).
Filename of the file to be read.
Where to start reading (in order to save memory by reading wave file piecewise), in units
.
Where to stop reading (in order to save memory by reading wave file piecewise), in 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.
If TRUE
, just header information of the Wave file are returned,
otherwise (the default) the whole Wave object.
If TRUE
, a WaveMC-class object is returned.
If NULL
(default) or FALSE
and a non-extensible Wave file or an extensible Wave file with no other than the “FL” and “FR”
channels is found, a Wave-class object is returned, otherwise a WaveMC-class object.
Uwe Ligges ligges@statistik.tu-dortmund.de, Sarah Schnackenberg
Wave-class, Wave
, WaveMC-class, WaveMC
, writeWave
Wobj <- sine(440)
tdir <- tempdir()
tfile <- file.path(tdir, "myWave.wav")
writeWave(Wobj, filename = tfile)
list.files(tdir, pattern = "\\.wav$")
newWobj <- readWave(tfile)
newWobj
file.remove(tfile)
Run the code above in your browser using DataLab