snd.write {rPraat}R Documentation

snd.write

Description

Saves Sound object to a file. snd is a list with $sig and $fs members at least. If $nBits is not present, default value of 16 bits is used. Vector $t is ignored. If the sound signal is 2-channel (stereo), $sig must be a two-column matrix (1st column corresponds to the left channel, 2nd column to the right channel). If the sound is 1-channel (mono), $sig can be either a numeric vector or a one-column matrix. optional $t, $nChannels, $nSamples, $duration vectors are ignored.

Usage

snd.write(snd, fileNameSound)

Arguments

snd

Sound object (with $sig, $nBits and $fs members)

fileNameSound

file name to be created

See Also

snd.read

Examples

## Not run: 
snd <- snd.sample()
snd.plot(snd)
snd.write(snd, "temp1.wav")

signal <- 0.8*sin(seq(0, 2*pi*440, length.out = 8000))
snd.write(list(sig = signal, fs = 8000, nBits = 16), "temp2.wav")

left  <- 0.3*sin(seq(0, 2*pi*440, length.out = 4000))
right <- 0.5*sin(seq(0, 2*pi*220, length.out = 4000))
snd.write(list(sig = matrix(c(left, right), ncol = 2), fs = 8000, nBits = 16), "temp3.wav")

## End(Not run)

[Package rPraat version 1.3.2-1 Index]