Get or set the duration (in seconds) of a Sample object or a wav file.
Usage
duration(s)
duration(s) <- value
setDuration(s,value)
Arguments
s
a Sample object, or a string giving the name of a wav file.
value
a double giving the duration in seconds.
Value
For duration, the duration of the sample in seconds.
For setDuration, a Sample object with the new duration.
Details
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).