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...

What is the value in x after this code is executed? int i = 4; int x = ++i;

A. 4 B. 5 C. 6 D. The statement won’t compile.

Computer Science & Information Technology

________ is the act of failing to acknowledge sources in a paper

Fill in the blank(s) with correct word

Computer Science & Information Technology

Because 3D text is implemented as an Alice ____, methods such as move, turn, and roll can be used to animate the text.

A. property B. namespace C. object D. constructor

Computer Science & Information Technology

In the context of malware, what is remediation?

What will be an ideal response?

Computer Science & Information Technology