Write a new version of Program 104 to copy “We the” into a new sound and then copy in “united” and finally copy in “people.” Be sure to add 2250 samples with a value of 0 in between the words. Return the new sound.
What will be an ideal response?
```
def splicePreamble2():
source = makeSound("preamble10.wav")
# This will be the newly spliced sound
target = makeEmptySoundBySeconds (5)
targetIndex =0
# Where the word "We The" is in the sound
for sourceIndex in range (8864 , 18235):
value = getSampleValueAt(source , sourceIndex)
setSampleValueAt(target , targetIndex , value)
targetIndex = targetIndex +1
#Silence Second
for silence in range(0, 2250):
setSampleValueAt(target , targetIndex , 0)
targetIndex = targetIndex +1
# Where the word "United" is in the sound
for sourceIndex in range (33414 , 40052):
value = getSampleValueAt(source , sourceIndex)
setSampleValueAt(target , targetIndex , value)
targetIndex = targetIndex +1
#Silence Second
for silence in range(0, 2250):
setSampleValueAt(target , targetIndex , 0)
targetIndex = targetIndex +1
# Where the word "People" is in for source
for sourceIndex in range(17408, 26726):
value = getSampleValueAt(source , sourceIndex)
setSampleValueAt(target , targetIndex , value)
targetIndex = targetIndex + 1
play(target)
return target
```
Note: The location of the “we the” start/end points can be found by making use of the explore() function in the terminal.
You might also like to view...
A recursive binary search algorithm always reduces the problem size by ______ at each recursive call.
a. 1 b. 2 c. half d. one-third
Which of the following techniques always toggles the "on" and "off" states of a radio button control?
(A) lick on the circle or its caption with the mouse. (B) Press the spacebar when the circle has the focus. (C) Press on another radio button in the same group box. (D) Set the Checked property equal to True. (E) None of the above