loadSample: Load a WAV File from Disk

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

View source: R/sound.R

Description

Load a wav file from disk and create a Sample object.

Usage

1
loadSample(filename, filecheck=TRUE)

Arguments

filename

a string giving the path and the name of the wav file.

filecheck

logical. If FALSE, no check for existance and read permission of the file will be performed.

Details

All kinds of wav files are supported: mono / stereo, 8 / 16 bits per sample, 1000 to 48000 samples/second.

Value

the Sample object that is equivalent to the wav file.

Note

filename can also be a Sample object. In this case, the same object will be returned immediately. This can be useful when writing functions that accept both Sample objects and the names of a wav file as an argument. See is.Sample for an example.

Author(s)

Author: Matthias Heymann <[email protected]>

Maintainer: Stefan Langenberg <[email protected]>

See Also

saveSample, as.Sample

Examples

1
2
3
4
5
## Not run: 
s <- loadSample("soundfile.wav")
play(s)

## End(Not run)

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