Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 2 Review Spring 2004: Re-splicing the splice

Comments, answers, and questions go here:

(Link back to Sp2004 Midterm 2 Review)


ok, here's my attempt at this one. i ran it in jes and it took from 1,8000 to clear out the word test.. is that ok, or is there another way to do it?

def spliceTest():
  file = r"C:\Documents and Settings\sana yousufi\My Documents\JES Software\MediaSources\thisisatest.wav"
  source = makeSound(file)
  target = makeSound(file)  #new sound
  targetIndex = 40326
  for sourceIndex in range (1,7865):
    setSampleValueAt(target, targetIndex, getSampleValueAt(source, sourceIndex))
    targetIndex = targetIndex + 1
  for index in range (1,8000): # quiet space
     setSampleValueAt(target, targetIndex, 0)
     targetIndex = targetIndex + 1
  play(target)
  return target

Sana Yousufi



Where are these numbers coming from, Sana?poof #2

def spliceTest():
  file = r"C:\whatever this path is
  source = makeSound(file)
  target = makeSound(file)  
  targetIndex = 40327
  for sourceIndex in range (1,7865):
    setSampleValueAt(target, targetIndex, getSampleValueAt(source, sourceIndex))
    targetIndex = targetIndex + 1
  for targetIndex in range (40327+7865,getLength(file)+1): 
     setSampleValueAt(target, targetIndex, 0)
     targetIndex = targetIndex + 1
  play(target)
  return target


Lauren, check the table that's provided. Mark Guzdial


what about this?
def spliceTest():
  file = r"C:\JES\mediasources\thisisatest.wav"
  source = makeSound(file)
  target = makeSound(file)  
  targetIndex = 40327
  for sourceIndex in range (1,7865):
    setSampleValueAt(target, targetIndex, getSampleValueAt(source, sourceIndex))
    targetIndex = targetIndex + 1
  for targetIndex in range (48192,getLength(source)+1): 
     setSampleValueAt(target, targetIndex, 0)
     targetIndex = targetIndex + 1
  play(target)
  return target



of course with the spacing being correct...i'm not sure what happened

def spliceTest():
  file = getMediaPath("thisisatest.wav")
  source = makeSound(file)
  target = makeSound(file)  
  targetIndex=40326        
  for sourceIndex in range( 1,7865):  
    setSampleValueAt(target, targetIndex,  getSampleValueAt( source, sourceIndex))
    targetIndex = targetIndex + 1
  for index in range (7865+40326,55770):
     setSampleValueAt(target, targetIndex, 0)
     targetIndex = targetIndex + 1
  play(target)	        
  return target

this works, but is is the easiest way to do this?

In this class, I care more about it working and that you understand, than efficiency. Mark Guzdial




Link to this Page