Fall2006.PythonMediaAPI History

Hide minor edits - Show changes to output

Added lines 3-4:
This is API documentation for the [[http://coweb.cc.gatech.edu/mediaComp-plan/94 | Mediacomp Software (JES, etc.)]] maintained by Mark Guzdial and his colleagues at Georgia Tech.
Changed line 218 from:
writeSoundTo(''sound'',"file.wav")
to:
blockingPlay(''sound'')
Added lines 220-224:
Plays a sound provided as input and makes sure that no other sound plays at the exact same time. No return value.

(:cellnr style='padding:5px;':)
writeSoundTo(''sound'',"file.wav")
(:cell style='padding:5px;':)
Changed line 208 from:
play(''sound'')
to:
makeEmptySound(''length'')
Changed lines 210-211 from:
Plays a sound provided as input. No return value.
to:
Creates an empty sound with ''length'' samples. Returns the sound.
Changed line 213 from:
writeSoundTo(''sound'',"file.wav")
to:
play(''sound'')
Added lines 215-219:
Plays a sound provided as input. No return value.

(:cellnr style='padding:5px;':)
writeSoundTo(''sound'',"file.wav")
(:cell style='padding:5px;':)
Changed lines 181-182 from:
!!Sounds
to:
!!Sound I/O

To input an external WAV file into an internal '''Sound''' encoding. \\
Also, to output an internal encoding to an external WAV file.
Changed line 213 from:
getSamples(''sound'')
to:
writeSoundTo(''sound'',"file.wav")
Changed lines 215-216 from:
Returns a list of samples from ''sound''.
to:
Writes ''sound'' to the file called "file.wav". Returns nothing.

(:tableend:)

!! Definitions

Objects used internally to store external sounds:

* Sound - an internal encoding of a sound, typically coming from am external WAV file.

* Sample - a value between -32768 and 32767 in the Sound. This represents the voltage that a microphone would generate (while recording the sound) at the given moment. The duration of this moment is typically 1/44K sec (for CD-quality sound).

* Samples - a sequence of Sample objects. For example, samples[1] returns the leftmost sample in a sound.

!! Sound Functions

To access the internal '''Sound''' encoding:

(:table border=1 width=80%:)
Changed line 236 from:
getSampleValueAt(''sound'',''index'')
to:
getLength(''sound'')
Changed lines 238-239 from:
Returns the sample of ''sound'' at ''index''.
to:
Returns the number of samples in ''sound''.
Changed line 241 from:
setSampleValueAt(''sound'',''index'')
to:
getSamplingRate(''sound'')
Changed lines 243-244 from:
Changes the sample of ''sound'' at ''index''.
to:
Returns the number of samples per second in ''sound''.
Changed line 246 from:
getLength(''sound'')
to:
getSamples(''sound'')
Changed lines 248-249 from:
Returns the number of samples in ''sound''.
to:
Returns a list of samples from ''sound''.
Changed line 251 from:
getSamplingRate(''sound'')
to:
getSampleValueAt(''sound'',''index'')
Changed lines 253-254 from:
Returns the number of samples per second in ''sound''.
to:
Returns the sample of ''sound'' at ''index''.
Changed line 256 from:
writeSoundTo(''sound'',"file.wav")
to:
setSampleValueAt(''sound'',''index'',''value'')
Changed lines 258-259 from:
Writes ''sound'' to the file called "file.wav". Returns nothing.
to:
Sets the sample of ''sound'' at ''index'' to ''value''.
Changed line 24 from:
makeEmptyPicture(''height'', ''width'')
to:
makeEmptyPicture(''width'', ''height'')
Changed line 26 from:
Takes a height and width as input, and creates
to:
Takes a width and height as input, and creates
Changed lines 183-184 from:
To open and play a sound.
to:
The following functions manipulate a sound.
Changed line 219 from:
getLength(''sound'')
to:
setSampleValueAt(''sound'',''index'')
Changed lines 221-222 from:
Returns the number of samples in ''sound''.
to:
Changes the sample of ''sound'' at ''index''.
Changed line 224 from:
getSamplingRate(''sound'')
to:
getLength(''sound'')
Changed lines 226-227 from:
Returns the number of samples per second in ''sound''.
to:
Returns the number of samples in ''sound''.
Changed line 229 from:
writeSoundTo(''sound'',"file.wav")
to:
getSamplingRate(''sound'')
Added lines 231-235:
Returns the number of samples per second in ''sound''.

(:cellnr style='padding:5px;':)
writeSoundTo(''sound'',"file.wav")
(:cell style='padding:5px;':)
Changed lines 238-245 from:
(:tableend:)





to:
(:tableend:)
Added line 190:
Added line 196:
Added line 202:
Added lines 207-232:

(:cellnr style='padding:5px;':)
getSamples(''sound'')
(:cell style='padding:5px;':)
Returns a list of samples from ''sound''.

(:cellnr style='padding:5px;':)
getSampleValueAt(''sound'',''index'')
(:cell style='padding:5px;':)
Returns the sample of ''sound'' at ''index''.

(:cellnr style='padding:5px;':)
getLength(''sound'')
(:cell style='padding:5px;':)
Returns the number of samples in ''sound''.

(:cellnr style='padding:5px;':)
getSamplingRate(''sound'')
(:cell style='padding:5px;':)
Returns the number of samples per second in ''sound''.

(:cellnr style='padding:5px;':)
writeSoundTo(''sound'',"file.wav")
(:cell style='padding:5px;':)
Writes ''sound'' to the file called "file.wav". Returns nothing.
Changed lines 235-238 from:
to: