Learn R Programming

sound (version 1.1)

loadSample: Load a WAV File from Disk

Description

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

Usage

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.

Value

  • the Sample object that is equivalent to the wav file.

Details

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

See Also

saveSample, as.Sample

Examples

Run this code
s <- loadSample("soundfile.wav")
play(s)

Run the code above in your browser using DataLab