left: Extract one Channel from a Stereo Sample

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sound.R

Description

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

Usage

1
2
left(s)
right(s)

Arguments

s

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

Details

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

Value

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

Author(s)

Author: Matthias Heymann <mail@MatthiasHeymann.de>

Maintainer: Stefan Langenberg <langenberg@uni-bonn.de>

See Also

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

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
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

## End(Not run)

sound documentation built on May 2, 2019, 2:10 a.m.

Related to left in sound...