# random amplificaion def increaseVolume(sound): for sample in getSamples(sound): value = getSampleValue(sample) setSampleValue(sample,value *10) # the correct way to do it is to use normalize def normalize(sound): largest = 0 for s in getSamples(sound): if getSampleValue(s) > largest: largest = getSampleValue(s) amplification = 32767.0 / largest print "Largest sample value in original sound was", largest print "Amplification factor is", amplification for s in getSamples(sound): louder = amplification * getSampleValue(s) setSampleValue(s, louder) def main(): f= pickAFile() s= makeSound(f) explore(s) increaseVolume(s) explore(s) writeSoundTo(s, 'C:\\Users\\alqudah\\Desktop\\temp.wav')