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).
if (FALSE) {
s <- Sine(440,3)
duration(s) # 3duration(s) <-.5# sample is now .5 sec longplay(setDuration(s,1)) # plays a .5 sec sine wave and then .5 sec silence}