CS 111 Lecture 13: LabNotes4 Increase the pitch of a sound

44 views2 pages
30 Nov 2016
School
Course
Professor

Document Summary

Def main(): fname = pickafile() s1 = makesound (fname); soundresult = reverse ( s1 ) explore (soundresult) def reverse ( sound ): # get a samplem list from the sound and the total number of samples samplelist = getsamples(sound) length = getlength(sound) sresult = makeemptysound ( length ) sresultlist = getsamples(sresult) # store the new amplitude value back into the sound modi = length-1 - i rsample = sresultlist[modi] setsamplevalue (rsample, value) return sresult def makesoundbyte ( sound , startindex, endindex) : # get a samplem list from the sound and the total number of samples samplelist = getsamples(sound) length = getlength(sound) sresult = makeemptysound ( endindex - startindex ) sresultlist = getsamples(sresult) # loop for all samples in the sound for i in range (startindex, endindex): # store the new amplitude value back into the sound modi = i - startindex rsample = sresultlist[modi] setsamplevalue (rsample, value) return sresult def increasevolume ( sound ) :

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Questions