WaveMC objects (or objects that can be coerced to
WaveMC objects) into an
IFFChunk-class object which
can be stored as a valid Iterchange File Format (
WaveToIFF( x, loop.start = NA, octaves = 1, compress = c("sCmpNone", "sCmpFibDelta"), ... )
If the sample should be looped from a specific position to the
end of the sample, this argument specifies the starting position in samples (with
a base of 0) for looping.
A whole positive
WaveMC objects can be read from contemporary file containers
readMP3. With this
function such objects can be converted into an
which can be stored conform the Interchange File Format (
x is not a pcm formatted 8-bit sample,
x will first be
normalised and scaled to a pcm-formatted 8-bit sample using
normalize. If you don't like the result you need to convert
the sample to 8-bit pcm yourself before calling this function.
IFFChunk-class object with a FORM container that
contains an 8SVX waveform based on
Pepijn de Vries
## Not run: ## First get an audio sample from the ProTrackR package snare.samp <- ProTrackR::PTSample(ProTrackR::mod.intro, 2) ## The sample can easily be converted into an IFFChunk: snare.iff <- WaveToIFF(snare.samp) ## You could also first convert the sample into a Wave object: snare.wav <- as(snare.samp, "Wave") ## And then convert into an IFFChunk. The result is the same: snare.iff <- WaveToIFF(snare.wav) ## You could also use a sine wave as input (although you will get some warnings). ## This will work because the vector of numeric data can be coerced to ## a WaveMC object sine.iff <- WaveToIFF(sin((0:2000)/20)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.