s = c(rep(0, 550), runif(400, -1, 1), rep(0, 50))
osc(s, samplingRate = 1000)
# true duration_noSilence is 400 ms
getDuration(s, samplingRate = 1000, silence = .01)
getDuration(s, samplingRate = 1000, silence = .1,
rms = list(windowLength = 5, step = 1))
if (FALSE) {
d = getDuration('~/Downloads/temp')
hist(d$duration - d$duration_noSilence)
}
Run the code above in your browser using DataLab