Write a function to set all the negative values of a sound to zero. Can you still understand any words in the sound?

What will be an ideal response?

```
def removeNegative(fileName):
sound = makeSound(fileName)
for sample in getSamples(sound):
value = getSampleValue(sample)
if (value<0):
setSampleValue(sample ,0)
play(sound)
return sound
```

While a bit grainy, all the words are still understandable.

Note: One could pass in a sound or a filename for this question. The important part is checking whether a value is negative and doing a specific operation based on that.

Computer Science & Information Technology

You might also like to view...

Which of the following is the best option to use to prevent spyware?

A. Personal software firewall B. Whitelists C. Antivirus software D. Windows Defender

Computer Science & Information Technology

When the applet viewer opens an HTML document with more than one applet tag:

A) it terminates immediately B) it displays the first applet, and then terminates C) it displays each applet in a separate window D) it displays each applet in order in the same window

Computer Science & Information Technology