Midterm Exam 2 Review Summer 2006: Sound Timing
Questions?
a) In recitation you said getSamplingRate() 2...
would this also work??—->(getLength(snd)/3)2
b)def mommapappa(sourceSound, targetSound):
while i = getSamplingRate(targetSound) 1.5
for i in sourceSound:
grab = getSampleValueAt(sourceSound, i + getSamplingRate(sourceSound)2)
copy = setSampleValueAt(targetSound, i + getSamplingRate(targetSound))
- and I don't have to return targetSound because sounds are object, and Jes remembers objects!!
- pls check it!!
| For a: No, you don't know how long the sound is so that would not work. For b: That while loop would not work at all. - Brittany Duncan |
b)
def secondSwitch (src, tar):
begin = int(getSamplingRate(src))
end = (3* begin)/2
for i in range (begin, end):
v = getSampleValueAt (src, i)
setSampleValueAt (tar, i+begin, v)
c)
def mfer(sound):
sr = int(getSamplingRate(sound))
begin = sr*3
end = sr*4
for i in range (begin, end):
v = getSampleValueAt(s, i)
setSampleValueAt(sound, i-sr*2, v)
these right?
a) getSamplingRate(sound)2+1
Link to this Page