library(soundgen) library(seewave) s1 = soundgen( sylLen = 315, pitch = c(250, 300, 270, 250), ampl = c(0, -40), temperature = 0.1, nonlinBalance = 40, subFreq = 150, subDep = 100, subWidth = 60, jitterDep = 0, shortestEpoch = 50, rolloff = -30, formants = list(f1 = c(500, 250), f2 = 1500, f3 = 2500, f4 = 3500, f5 = 5500), mouth = c(.5, .6), noise = data.frame(time = c(0, 215, 400), value = c(-20, -15, -40)), rolloffNoise = 0, addSilence = 0, samplingRate = 22050, play = T, plot = T, osc = T ) s2 = soundgen( sylLen = 180, pitch = c(240, 260, 245, 240), rolloff = c(-14, -18, -18), temperature = 0.2, formants = c(490, 1500, 2500), noise = data.frame(time = c(-275, -175, 200), value = c(-50, -25, -40)), rolloffNoise = -8, addSilence = 0, attackLen = 10, samplingRate = 22050, play = T, plot = T, osc = T ) t = c(0, 60, 130, 190, 310) / 310 s3 = soundgen( repeatBout = 2, sylLen = 310, pauseLen = 0, pitch = data.frame(time = t, value = c(240, 260, 240, 260, 240)), rolloff = getSmoothContour(len = 30, interpol = 'approx', anchors = data.frame(time = t, value = c(-20, -14, -30, -14, -18))), temperature = 0.1, formants = c(490, 1500, 2500), noise = data.frame(time = c(-10, 130, 320), value = c(-45, -15, -35)), rolloffNoise = -8, addSilence = 0, attackLen = c(10, 50), samplingRate = 22050, play = T, plot = T, osc = T ) s3 = fade(s3, fadeIn = 0, fadeOut = length(s3) / 2) s = addVectors(s1, s2, insertionPoint = 22050 * .5) s = addVectors(s, s3, insertionPoint = length(s) - 22050 * .03) playme(s, 22050) savewav(s, f = 22050, filename = 'cry_498_soundgen.wav')