# This function blends 2 sounds.
def makeMix(sound1, sound2, mixValue1, mixValue2):
newLength = min(getLength(sound1) ,getLength(sound2))
newSound = makeEmptySound(newLength)
for index in range(0,newLength):
sample1 = getSampleValueAt (sound1, index)
sample2 = getSampleValueAt (sound2, index)
newSample = mixValue1*sample1 + mixValue2*sample2
setSampleValueAt (newSound, index, newSample)
return newSound
def makeMix(sound1, sound2, mixValue1, mixValue2):
newLength = min(getLength(sound1) ,getLength(sound2))
newSound = makeEmptySound(newLength)
for index in range(0,newLength):
sample1 = getSampleValueAt (sound1, index)
sample2 = getSampleValueAt (sound2, index)
newSample = mixValue1*sample1 + mixValue2*sample2
setSampleValueAt (newSound, index, newSample)
return newSound
No comments:
Post a Comment