playWave: Play Wave objects

playWaveR Documentation

Play Wave objects

Description

Use the command line play function from the audio package to play Wave objects.

Usage

## S4 method for signature 'Wave'
playWave(wave, wait = T)

## S4 method for signature 'WaveMC'
playWave(wave, wait = T)

Arguments

wave

An object of class Wave or WaveMC. Note that the playing routine implemented here can only play stereo waves. Multi-channel waves are therefore converted to stereo before playing.

wait

A logical value. When set to TRUE the playing routine will wait with executing any code until the playing is finished. When set to FALSE, subsequent R code will be executed while playing.

Details

As the tuneR package play-function relies on external players, this method is provided as a convenient approach to play samples in the R console, using the audio package. Wave objects are played at the rate as specified in the object. Of course you can also play the Wave objects with the tuneR implementation of tuneR{play}, by calling tuneR::play(wave).

Value

Returns an $.audioInstance.

Author(s)

Pepijn de Vries

See Also

Other play.audio.routines: playMod(), playSample()

Examples

## Not run: 
data(mod.intro)

## PTSample objects can also be
## played with this function as they
## are a child of the Wave object:
playWave(PTSample(mod.intro, 2))

## End(Not run)

ProTrackR documentation built on Aug. 23, 2023, 1:07 a.m.