Code for function makeSentence()
def makeSentence():
file = 'howdoin.wav'
source = makeSound(file)
target = makeSound(file)
#clear the target sound
for index in range(1, getLength(target)+1):
setSampleValueAt(target, index, 0)
#start increment of target index
target_index = 1
#copy 'So'
for index in range(1394,5617+1):
value = getSampleValueAt(source, index)
setSampleValueAt(target, target_index, value)
target_index = target_index + 1
#make a 1/4 second space
for index in range (1, int(getSamplingRate(source)/4)+1):
setSampleValueAt(target, target_index, 0)
target_index = target_index + 1
#copy 'how'
for index in range(15580,17917+1):
value = getSampleValueAt(source, index)
setSampleValueAt(target, target_index, value)
target_index = target_index + 1
#make a 1/4 second space
for index in range (1, int(getSamplingRate(source)/4)+1):
setSampleValueAt(target, target_index, 0)
target_index = target_index + 1
#copy 'you'
for index in range(17917,20418+1):
value = getSampleValueAt(source, index)
setSampleValueAt(target, target_index, value)
target_index = target_index + 1
#make a 1/4 second space
for index in range (1, int(getSamplingRate(source)/4)+1):
setSampleValueAt(target, target_index, 0)
target_index = target_index + 1
#copy 'doin'
for index in range(20541,24354+1):
value = getSampleValueAt(source, index)
setSampleValueAt(target, target_index, value)
target_index = target_index + 1
openSoundTool(source)
openSoundTool(target)
Link to this Page