Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MonoStereo

Converting (extracting, joining) stereo to mono and vice versa


Description

Functions to extract a channel from a stereo Wave object, and to join channels of two monophonic Wave objects to a stereophonic one.

Usage

mono(object, which = c("left", "right", "both"))
stereo(left, right)

Arguments

object

Object of class Wave.

which

Character, indicating whether the “left” or “right” channel should be extracted, or whether “both” channels should be averaged.

left

Object of class Wave containing monophonic sound, to be used for the left channel.

right

Object of class Wave containing monophonic sound, to be used for the right channel (if missing, the left channel is duplicated). If right is missing, stereo returns whether left is stereo (TRUE) or mono (FALSE).

Details

For objects of WaveMC-class, a mono channel can be created by simple matrix indexing, e.g. WaveMCobject[,2] selects the second channel.

Value

An object of class Wave.

If argument right is missing in stereo, a logical values is returned that indicates whether left is stereo (TRUE) or mono (FALSE).

Author(s)

See Also

Examples

Wobj <- sine(440)
Wobj
Wobj2 <- stereo(Wobj, Wobj)
Wobj2
mono(Wobj2, "right")

tuneR

Analysis of Music and Speech

v1.3.3
GPL-2 | GPL-3
Authors
Uwe Ligges <ligges@statistik.tu-dortmund.de> with contributions from Sebastian Krey, Olaf Mersmann, Sarah Schnackenberg, Guillaume Guenard, Andrea Preusser, Anita Thieler, Johanna Mielke and Claus Weihs, as well as code fragments and ideas from the former package 'sound' by Matthias Heymann and functions from 'rastamat' by Daniel P. W. Ellis. The included parts of the libmad MPEG audio decoder library are authored by Underbit Technologies.
Initial release
2018-07-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.