Question: Rewrite increase volume (Program 93) so that it takes two inputs: a sound to increase in volume and a multiplier. Use the multiplier as how

Rewrite increase volume (Program 93) so that it takes two inputs: a sound to increase in volume and a multiplier. Use the multiplier as how much to increase the amplitude of the sound samples. Can we use the same function to both increase and decrease the volume? Demonstrate commands that you would execute to do each.


Data from Program 93

def increaseVolume (sound): for sample in getSamples(sound): getSampleValue(sample) * 2) value setSampleValue(sample,value

def increaseVolume (sound): for sample in getSamples(sound): getSampleValue(sample) * 2) value setSampleValue(sample,value

Step by Step Solution

3.42 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Yes you can use the same method to increase and decrease the volume Values ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!