Learn R Programming

sequenceR (version 1.0.1)

as.soundSample: Cast to a sound sample

Description

Convert a tuneR::Wave object into a soundSample.

Usage

as.soundSample(w, pan = 0)

Value

An object of class 'soundSample'.

Arguments

w

tuneR Wave object

pan

Numeric in [-1;1], panoramic. -1 (resp. 1) only select the left (resp. right) channel of w (if the latter is stereo). 0 averages both channels

Examples

Run this code
w <- tuneR::Wave(left=sin(2*pi*seq(0,1,,44100)*440)) # 1-second A
sam <- as.soundSample(w)
plot(sam)

Run the code above in your browser using DataLab