def merge(sound1,sound2): target= makeEmptySound(6*44100) #target = makeSound(getMediaPath("sec3silence.wav")) index = 0 for source in range(0, getLength(sound1)): value = getSampleValueAt(sound1, source) setSampleValueAt(target, index, value) index = index + 1 for source in range(0, int(0.2*getSamplingRate(target))): setSampleValueAt(target, index, 0) index = index + 1 for source in range(0, getLength(sound2)): value = getSampleValueAt(sound2, source) setSampleValueAt(target, index, value) index = index + 1 return target def main(): file = pickAFile() sound1 = makeSound(file) file= pickAFile() sound2= makeSound(file) sound3= merge(sound1,sound2) explore( sound3) writeSoundTo(sound3,"/Users/bilal/Desktop/sound3.wav")