# returns a new sound that is the portion of "source" from "start" to "end"
# doesn't alter the original sound.
def clip (source, start, end):
target = makeEmptySound (end - start, 44100)
targetIndex = 0
for sourceIndex in range (start, end):
sourceValue = getSampleValueAt (source, sourceIndex)
setSampleValueAt (target, targetIndex, sourceValue)
targetIndex = targetIndex + 1
return target
# doesn't alter the original sound.
def clip (source, start, end):
target = makeEmptySound (end - start, 44100)
targetIndex = 0
for sourceIndex in range (start, end):
sourceValue = getSampleValueAt (source, sourceIndex)
setSampleValueAt (target, targetIndex, sourceValue)
targetIndex = targetIndex + 1
return target
No comments:
Post a Comment