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

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

meanhw

import os

def linkspage(directory):
samplesfile=open(directory + "//index.html","wt")
samplesfile.write(doctype())
samplesfile.write(title("Samples from" + directory))
#Now, let's makeup the string that will be the body
samples = "

Samples from" + directory + "

\n"
for file in os.listdir(directory):
if file.endswith(".jpg"):
img = makePicture(directory + "/" + file)
newWidth=getWidth(img)/2
newHeight= getHeight(img)/2
samples = samples + "

Filename: "+ file
samples = samples + ''
samples = samples + '

\n'
if file.endswith(".wav"):
sound=makeSounds(directory + "/" + file)
if getSamplingRate(sound)/getREMOVEDngth(sound)3:
samples = samples + '' + file + '(full) '
else:
previewSound=makeEmptySound(3)
previewIndex = 1
for originalIndex in range(getREMOVEDngth(sound) - int(1.5 getSamplingRate(sound), getREMOVEDngth(sound))
sampleValue = getSampleValueAt(sound, originalIndex)
setSampleValueAt(preview, previewIndex, SampleValue)
previewIndex = previewIndex + 1
for originalIndex in range(getREMOVEDngth(sound) - (int)(1.5getSamplingRate(sound)), getREMOVEDngth(sound) + 1):
sampleValue = getSampleValueAt(sound, originalIndex)
setSampleValueAt(previewSound, previewIndex, SampleValue)
previewIndex = previewIndex + 1
writeSoundTo(previewSound, directory + "//short_" + file)
samples = samples + '' + file + '(full)' #write out the HTML code to display a line to this sound
samples = samples + '' + file '(short)'

Link to this Page