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...
To create a copy of a file onto a different storage device or with a different name, you use the ________ command
A) Open B) Save C) Save As D) Open As
Computer Science & Information Technology
Select all that apply. Which of the following operating systems use a GUI?
a. Windows b. Mac OS c. DOS d. Liux
Computer Science & Information Technology