The basic object of this package is a variable of the new class Sample
with properties for
the sampling rate.
the number of bits per sample.
the waveform matrix itself, which is a matrix with one or two rows
(for mono or stereo sounds), each row representing one channel.
The rows are sequences of values in [-1, 1] that discretize the waveform of the sound.
Sample objects can be created with the command as.Sample
sample <- as.Sample(sound,rate,bits)
where sound is the waveform matrix of the sample.
Alternatively, one can use loadSample
sample <- loadSample(filename)
to load a wav-file on the hard disk and convert it into a Sample object. Similarly,
one can save a Sample object as a wav-file, using saveSample
saveSample(sample,filename)