Write a function called erasePart to set all the samples in the 2nd second of thisisatest.wav to 0’s—essentially, making the 2nd second go silent. (Hint: Remember that getSamplingRate(sound) tells you the number of samples in a single second in a sound.) Play and return the partially erased sound.

What will be an ideal response?


```
def erasePart():
sound = makeSound("thisisatest.wav")
soundSamples = getSamples(sound)
sampleRate = getSamplingRate(sound)

for index in range(sampleRate, sampleRate*2):
setSampleValue(soundSamples[index] ,0)

play(sound)
return sound
```

Computer Science & Information Technology

You might also like to view...

At design time, a PrintPreviewDialog is displayed in ________.

a) the Solution Explorer b) the component tray c) the Server Explorer d) the Properties window e) None of the above.

Computer Science & Information Technology

Physical security includes which of the following?

A) Securing the servers and workstations B) Controlling access to the company facilities C) Knowing how to respond to fires D) All of the above

Computer Science & Information Technology

Which of the following is a good reason for backing up your data to the cloud?

a. If the cloud storage provider you use goes bankrupt, you will still have access to most of the current data. b. If your computer is stolen, you still have access to most of your current data. c. In the event of a disaster at the cloud data center you use, you still have access to most of the current data. d. Backing up is generally a good idea.

Computer Science & Information Technology

What name is given to the port numbers in the range of 0 to 1023?

A. Private port numbers B. Dynamic port numbers C. Well-known port numbers D. Listening ports

Computer Science & Information Technology