sound (version 1.4.5)

left: Extract one Channel from a Stereo Sample

Description

Extract either the left or the right channel of a stereo Sample object or a stereo wav file.

Usage

left(s)
right(s)

Value

a Sample object containing the left or the right channel of s.

Arguments

s

a Sample object, or a string giving the name of a wav file.

Author

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

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

Details

If s is a mono sample, it will be returned as it is.

See Also

stereo for creating a stereo Sample object from two mono samples.

Examples

Run this code
if (FALSE) {
sLeft <- Sine(440,1)
sRight <- Sine(220,1)
s <- stereo(sLeft,sRight)
play(s)
play(left(s))  # only the left channel
play(right(s)) # only the right channel
}

Run the code above in your browser using DataLab