library(soundgen) library(seewave) s1 = soundgen( nSyl = 3, sylLen = c(100, 170, 390), pauseLen = c(60, 0), pitch = data.frame(time = c(0, .2, 1), value = c(365, 470, 430)), vibratoDep = .25, rolloff = c(-15, -12), amplGlobal = c(-5, 0, -3), formants = c(1000, 1600, 2400, 4000, 4700, 5600, 7300, 7800), mouth = c(.5, .5, .4), noise = data.frame(time = c(-50, 20, 40, 70, 90, 150), value = c(-40, -25, -35, -35, -25, -60)), formantsNoise = c(400, 1000, 1600, 2400, 4000, 4700, 5600, 7300, 7800), rolloffNoise = 0, attackLen = 40, temperature = 0.05, addSilence = 0, samplingRate = 22050, pitchSamplingRate = 22050, play = T, plot = T, osc = T, ylim = c(0, 8) ) s2 = soundgen( sylLen = 130, pitch = data.frame(time = c(0, 30, 85, 130), value = c(600, 300, 370, 300)), rolloff = c(-16, -15, -11, -13), formants = c(400, 2200, 2500, 3600, 4700, 5600, 7300, 7800), attackLen = 20, temperature = 0.05, addSilence = 0, samplingRate = 22050, pitchSamplingRate = 22050, play = T, plot = T, osc = T, ylim = c(0, 8) ) s3 = soundgen( sylLen = 250, pitch = data.frame(time = c(0, 115, 175, 250), value = c(1800, 800, 370, 700)), interpol = 'approx', ampl = data.frame(time = c(0, 100, 110, 160, 165, 250), value = c(-5, -10, -50, -50, 0, -3)), rolloff = -30, formants = c(400, 2200, 2500, 3600, 4700, 5600, 7300, 7800), noise = data.frame(time = c(0, 100, 110, 160, 165, 250, 300), value = c(-30, -30, -60, -60, -10, -15, -50)), rolloffNoise = c(.6, -12, -6), attackLen = 20, temperature = 0.05, addSilence = 0, samplingRate = 22050, pitchSamplingRate = 22050, play = T, plot = T, osc = T, ylim = c(0, 8) ) s = addVectors(s1 * 5, s2, insertionPoint = length(s1) -22050 * .05) s = addVectors(s, s3 / 3, insertionPoint = length(s1) -22050 * .05) playme(s, 22050) savewav(s, f = 22050, filename = 'laugh_302a_soundgen.wav')