doubleFrequency
def double(filename):
source = makeSound(filename)
target = makeSound(filename)
targetIndex = 1
for sourceIndex in range(1, getLength(source) + 1, 2):
value = getSampleValueAt(source, sourceIndex)
setSampleValueAt( target, targetIndex, value)
targetIndex = targetIndex + 1
#Zero out the rest of the target sound -- it's only half full!
# Zeros are silent.
for targetIndex in range( getLength( target)/2, getLength( target)+1):
setSampleValueAt(target, targetIndex, 0)
targetIndex = targetIndex + 1
return target
Link to this Page