# Doubles the frequency of the sound
def doubleFrequency(source):
len = getLength(source)/2 + 1
target = makeEmptySound (len)
targetIndex = 0
for sourceIndex in range (0, getLength(source), 2):
sourceValue = getSampleValueAt (source, sourceIndex)
setSampleValueAt (target, targetIndex, sourceValue)
targetIndex = targetIndex + 1
return (target)
def doubleFrequency(source):
len = getLength(source)/2 + 1
target = makeEmptySound (len)
targetIndex = 0
for sourceIndex in range (0, getLength(source), 2):
sourceValue = getSampleValueAt (source, sourceIndex)
setSampleValueAt (target, targetIndex, sourceValue)
targetIndex = targetIndex + 1
return (target)
No comments:
Post a Comment