CSC108H1 Lecture : september 23 notes

19 views2 pages
11 Jan 2013
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
21
CSC108H1 Full Course Notes
Verified Note
21 documents

Document Summary

Import sound, generate copy of sound file w/o left channel. Sound song is unchanged. : import sound, def zero_left(song), song = sound. load_sound( doglake. wav , song_zeroed = zero_left(song) #or play directly: sound. play(zero_left(song), sound. play(song_zeroed) new_song = sound. copy(song) # makes a new copy for sample in new_song: sound. set_left(sample, 0) return new_song. Change song directly, no new file: import sound, def zero_left(song): for sample in new_song: Return sound song with the left channel turned off. sound. set_left(sample, 0) # no return new_song; left channel in song removed in memory: song = sound. load_sound( doglake. wav , song_zeroed = zero_left(song) #or play directly: sound. play(zero_left(song), sound. play(song_zeroed) Local song value same as the global sound value; changes made to the file in memory. Do not name a variable sound: import sound, sound = sound. load_sound( laught. wav ) # removes the sound library, sound. play(sound) Return a new copy of sound song with the left channel muted.

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 Documents

Related Questions