Write a function that will blend three sounds together. Start with part of the first sound, then a blend of sound1 and sound2, and then a blend of sound2 and sound3, and end with the rest of sound3.
What will be an ideal response?
```
def blendThree(sound1,sound2, sound3):
maxL = max(getLength(sound1), getLength(sound2))
maxL2 = max(getLength(sound2), getLength(sound3))
canvas=makeEmptySound(maxL+maxL2+getLength(sound1)+getLength(sound3))
#Copy all of sound one
for index in range(0, getLength(sound1)):
soundSample = getSampleValueAt(sound1,index)
setSampleValueAt(canvas ,index ,soundSample)
#Blend sound1 and sound2
for index in range (0 ,maxL):
soundSample = 0
if index
sound2Sample = 0
if index
newSample = 0.5* soundSample + 0.5* sound2Sample
setSampleValueAt(canvas ,index+getLength(sound1),newSample)
#Blend sound2 and sound3
for index in range (0 ,maxL2):
soundSample = 0
if index
sound2Sample = 0
if index
newSample = 0.5* soundSample + 0.5* sound2Sample
setSampleValueAt(canvas ,index+getLength(sound1)+maxL,newSample)
for index in range (0 ,getLength(sound3)):
sound2Sample = getSampleValueAt(sound3,index)
setSampleValueAt(canvas ,(index+getLength(sound)+maxL+maxL2),sound2Sample)
play(canvas)
return canvas
```
You might also like to view...
Windows 10 introduced the for building Windows apps that run on desktop computers, notebook computers, tablets, phones, Xbox and even Microsoft’s new HoloLens augmented reality holographic headset—all using nearly identical code.
Fill in the blank(s) with the appropriate word(s).
Only ________ space(s) should follow any punctuation mark
A) one B) two C) three D) four
You can use layers to ____.
a. apply special effects b. repair damaged photos c. import text elements d. all of the above
Users requesting directory data from AD LDS instances must be authenticated before they can receive access. In general, these users run a directory-enabled application that makes an LDAP request to AD LDS. AD LDS must successfully authenticate users to the directory, which is a process also known as _____________
a. Attaching b. Binding c. Controlling d. None of the above.