writeWave

0th

Percentile

Writing Wave files

Writing Wave files.

Keywords
file, IO
Usage
writeWave(object, filename, extensible = TRUE)
Arguments
object

Object of class Wave or WaveMC to be written to a Wave file.

filename

Filename of the file to be written.

extensible

If TRUE (default), an extensible Wave format file is written. If FALSE, a non-extensible Wave file is written.

Details

It is only possible to write a non-extensible Wave format file for objects of class Wave or for objects of class WaveMC with one or two channels (mono or stereo).

If the argument object is a Wave-class object, the channels are automatically chosen to be “FL” (for mono) or “FL” and “FR” (for stereo).

The channel mask used to arrange the channel ordering in multi channel Wave files is written according to Microsoft standards as given in the data frame MCnames containing the first 18 standard channels. In the case of writing a multi channel Wave file, the column names of the object object (colnames(object)) must be specified and must uniquely identify the channel ordering for WaveMC objects. The column names of the object of class WaveMC have to be a subset of the 18 standard channels and have to match the corresponding abbreviated names. (See MCnames for possible channels and the abbreviated names: “FL”, “FR”, “FC”, “LF”, “BL”, “BR”, “FLC”, “FRC”, “BC”, “SL”, “SR”, “TC”, “TFL”, “TFC”, “TFR”, “TBL”, “TBC” and “TBR”).

The function normalize can be used to transform and rescale data to an appropriate amplitude range for various Wave file formats (either pcm with 8-, 16-, 24- or 32-bit or IEEE_FLOAT with 32- or 64-bit).

Value

writeWave creates a Wave file, but returns nothing.

See Also

Wave-class, Wave, WaveMC-class, WaveMC, normalize, MCnames, readWave

Aliases
  • writeWave
Examples
# NOT RUN {
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)
# }
Documentation reproduced from package tuneR, version 1.3.3, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.