Make an audio collage. Make it at least 5 seconds long, and include at least two different sounds (i.e., they come from different files). Make a copy of one of those different sounds and modify it using any of the techniques described in this chapter (i.e., mirroring, splicing, volume manipulations). Splice together the original two sounds and the modified sound to make the complete collage.

This example specifically makes use of “preamble10.wav” and “the.wav”, but as long as the end result is over 5 seconds, any sounds may be used.


```
def collage():
source = makeSound("preamble10.wav")
source2 = makeSound("the.wav")
modified = makeEmptySound(getLength(source2))

modifiedSamples = getSamples(modified)
source2Samples = getSamples(source2)
#Mirror Modified
for sourceIndex in range(0, getLength(source2)):
sourceValue = getSampleValue(source2Samples[sourceIndex])
setSampleValue(modifiedSamples[getLength(source2)-1-sourceIndex] ,sourceValue)

#Copy them all over
target =
makeEmptySound((getLength(source)+getLength(source2)+getLength(modified)))
targetIndex = 0
targetSamples = getSamples(target)
sourceSamples=getSamples(source)

#Copy Source 2
for index in range(0, getLength(source2)):
sourceValue = getSampleValue(source2Samples[index])
setSampleValue(targetSamples[targetIndex] ,sourceValue)
targetIndex = targetIndex+1

#Copy Source 1
for index in range(0, getLength(source)):
sourceValue = getSampleValue(sourceSamples[index])
setSampleValue(targetSamples[targetIndex] ,sourceValue)
targetIndex = targetIndex+1

#Copy Modified
for index in range(0, getLength(modified)):
sourceValue = getSampleValue(modifiedSamples[index])
setSampleValue(targetSamples[targetIndex] ,sourceValue)
targetIndex = targetIndex+1

play(target)
return target
```

Computer Science & Information Technology

You might also like to view...

Create an applet ScoreKeeper that keeps track of the score in a football game. To display the scores, the applet will have four labels in the north area. Two of the labels will display the name of the team. The other two labels will display the current score of the teams. In the center of the application will be a number of buttons: one for each team, one for each of the three basic ways to score—touchdown, field goal, and safety—and three buttons for the events that can happen after a touchdown— one-point conversion, two-point conversion, and failed to convert. Initially, there will just be two text areas and an Accept Names button in the south area of the applet. The text areas will be used to enter the names of the two teams. When the button is clicked, the team names will appear in the

This application looks at how we can change the appearance by making components visible or invisible. The solution uses a number of methods whose job is just to set the visibility of the components. This abstraction helps simplify the actionPerformed method. The solution also uses getSource() to check which component generated the event as it simplifies the code a bit for the buttons that get labeled with the team names. It is relatively easy to change it so that it checks for the string instead.

Computer Science & Information Technology

EBT is an acronym forEBT is an acronym for

(a) Electronic Business Technology. (b) Electronic Business Transfer. (c) Electronic Benefits Technology. (d) Electronic Benefits Transfer.

Computer Science & Information Technology

To insert and work with tab stops, it helps if the ________ is showing

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which of the following is NOT a choice on the Shape Effects list?

A) Reflection B) Shine C) Bevel D) Soft Edges

Computer Science & Information Technology