sound (version 1.4.5)

plot.Sample: Plot a Sample Object

Description

Plot the waveform of a Sample object or a wav file.

Usage

# S3 method for Sample
plot(x,xlab="sample #",ylab=NULL,...)

Arguments

x

a Sample object, or a string giving the name of a wav file. If x is a string, the explicit form plot.Sample must be used.

xlab

the character string giving the label for the x-axis.

ylab

For mono Sample objects as usual. For stereo Sample objects, ylab can be a vector of two strings to distinguish the y-labels for the left and the right channel. If ylab=NULL, the presets are used, that is "waveform" for mono samples and c("left","right") for stereo samples.

...

further graphical parameters.

Author

Author: tools:::Rd_package_author("sound")

Maintainer: tools:::Rd_package_maintainer("sound")

See Also

print.Sample

Examples

Run this code
if (FALSE) s <- Sine(440,1) + .4*Sine(1000,1)
plot(s[1:1000])
play(s)
s <- normalize(s)
plot(s[1:1000])  # now the range of the waveform is in [-1,1]
play(s)  # no cracks!

Run the code above in your browser using DataCamp Workspace