Write a function to increase the volume for all the positive values and decrease the volume for all the negative values. Can you still understand any words in the sound?

What will be an ideal response?


```
def makeMorePositive(fileName):
sound = makeSound(fileName)
for sample in getSamples(sound):
value = getSampleValue(sample)
if (value>0):
setSampleValue(sample ,value * 2)
else:
setSampleValue(sample ,value/2)
play(sound)
return sound
```

Yes, all 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 positive or negative and doing a specific operation based on that.

Computer Science & Information Technology

You might also like to view...

A cable is running along the floor between two work areas where people walk.   Which of the following steps should be taken first?

A. Implement cable management. B. Cut the cable and remove it. C. Try to run the cable overhead. D. Call the building maintenance department.

Computer Science & Information Technology

When the computer processes the expression 12 > 0 AndAlso 12 < 10 * 2, it evaluates the ____ operator last.

A. * B. < C. > D. AndAlso

Computer Science & Information Technology

__________ is a subclass of Animation.

a. PathTransition b. FadeTransition c. Timeline d. Duration

Computer Science & Information Technology

The ____________________ provides a printing interface on a local network.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology