Description Usage Arguments Details Value Author(s) See Also Examples
Get or set the duration (in seconds) of a Sample object or a wav file.
1 2 3 | duration(s)
duration(s) <- value
setDuration(s,value)
|
s |
a Sample object, or a string giving the name of a wav file. |
value |
a double giving the duration in seconds. |
The replacement form can be used to reset the duration of the Sample object (here, filenames are not accepted).
If a Sample object is shortened, extra values are discarded. When a Sample object is lengthened, it is padded out to its new length with zeros (silence).
For duration
, the duration of the sample in seconds.
For setDuration
, a Sample object with the new duration.
Author: Matthias Heymann <mail@MatthiasHeymann.de>
Maintainer: Stefan Langenberg <langenberg@uni-bonn.de>
1 2 3 4 5 6 7 | ## Not run:
s <- Sine(440,3)
duration(s) # 3
duration(s) <-.5 # sample is now .5 sec long
play(setDuration(s,1)) # plays a .5 sec sine wave and then .5 sec silence
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.