s = soundgen()
a = soundgen:::.analyze(soundgen:::readAudio(s, samplingRate = 16000),
windowLength = 25, step = 25,
returnPitchCands = TRUE, plot = FALSE)
spectrogram(s, 16000, windowLength = 25, step = 5, ylim = c(0, 1), osc = FALSE)
soundgen:::addPitchCands(
pitchCands = a$pitchCands$freq,
pitchCert = a$pitchCands$cert,
pitchSource = a$pitchCands$source,
pitch = a$result$pitch,
timestamps = a$result$time / 1000)
Run the code above in your browser using DataLab