View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

New Media Support for CPython

Updated 22 June 2006


From Nadeem Abdul Hamid

I've been looking at using the CPython version of your media computation library (http://coweb.cc.gatech.edu/mediaComp-plan/117) in an introductory CS course at my college. As a result of that, I've made several enhancements and bugfixes to the file that's available at your web page, which are documented in the comments at the top of the file attached to this email. I just thought I'd send you a copy in case you wanted to post this version also on your web page. I'm also including a copy of a graphics library developed by John Zelle because his code provides a couple of functions that wrap around Tkinter and make it run in a separate thread so that it doesn't interfere when used with the IDLE development environment. I've found that the result is pretty robust on both Windows and Macs. My version of the mymedia.py library depends on this graphics.py in addition to the other packages listed at http://coweb.cc.gatech.edu/mediaComp-plan/117 (e.g. PIL, pygame, numpy, etc.)


Earlier Version


HOW TO USE THIS

Uploaded Image: CPython.jpg

Deatailed installation instructions:


Installation.pdf

Mac Installer!

There are two different installers one for OS X 10.3 Panther and one for OS X 10.4 Tiger. Make sure you get thr right one, downloading and installing the incorrect installer is a bad thing and can cause some serious problems as the Panther installer adds some packages that Tiger comes pre-bundled with. The result is that these standard packages would get overwritten and the new ones do not work correctly with Tiger yet. Eventually we hope to include these in the Tiger install as well as they are more stable distributions in general, but until they work with Tiger this transition cannot be completed.

mediaPantherComp.dmg
mediaTigerComp.dmg

Keep in mind that we are developing an installation package using DisUtils, which will be added to the website very soon. Once that is added you will not have to manually install any of these packages except for Python.

Windows:
(media.py-1.2-fullinstall.exe)
self-extracting zip file. Open it and run the four installers.




(old install method: useful if above methods do not work)


Mac:



Windows: If you get the Enthought Python at http://www.enthought.com/python/, then just install pyGame at ftp://pygame.org/pub/pygame/pygame-1.6.win32-py2.3.exe, you can download media.py then start Python and type from media import *. And it works! (See screenshot at bottom.)
If using python.org python, you will need to install PyGame, PIL, and Numeric, then media.py.
(http://effbot.org/downloads/PIL-1.1.5.win32-py2.3.exe)
(http://pygame.org/ftp/old/pygame-1.5.5D.win32-py2.3.exe)
(http://prdownloads.sourceforge.net/numpy/Numeric-24.2.win32-py2.3.exe?use_mirror=internap)
(media.py-1.win32.exe)


Linux light weight RPM package:(media.py-1.0-1.src.rpm)


Usage


Put the media.py file somewhere in the Python search path and in test files place the line: 'from media import * ' you can also simply type 'import media' but this means you have to call all Objects and functions by prefixing media to them 'media.makePicture(filename)' for example.

Bug Reporting

Because we know there will be bugs and probably a whole bunch of them you can submit bugs to media.py.bugs@gmail.com. Please give us a the offending code and the error or problem encountered.

Note: One of the requirements we have for this implementation is that to the user the change is transparent as far as functionaity is concerned. So if a function works but works differently than it did in the past this counts as an error so go ahead and submit it.


Known Issues



Download


Version 1.2
media.py_

Changes



What's New?



General Info

for Sound:

The package should open almost any .wav file, but all files will be
converted to a 22050Hz 16bit sound in memory for use in media.py
Therefor, any files you save will be in that format, as well as
the return value for the getLength() function.

There are no known issues at this time.

for Sound Object:

Sound()
Sound("filename.wav")
makeEmptyLength(sec)
play()
playInRange(start,stop)
blockingPlay()
blockingPlayInRange(start,stop)
getSamples()
getLength()
getSampleValue(index)
setSampleValue(index,value)
getSamplingRate()
getSampleObjectAt(index)
writeTo(filename)

for Samples Object:

Samples(aSound)
getSound()

for Sample Object:

Sample(aSound,index)
setValue(value)
getValue()
getSound()

Global functions from medai.py:

makeSound(filename)
makeEmptySound(size)
getSamples(sound)
play(sound)
blockingPlay(sound)
playInRange(sound,start,stop)
blockingPlayInRange(sound,start,stop)
getSamplingRate(sound)
setSampleValueAt(sound,index,value)
getSampleValueAt(sound,index)
getSampleObjectAt(sound,index)
setSample(sample,value)
getSample(sample)
getSound(sample)
getLength(sound)
writeSoundTo(sound,filename)

Uploaded Image: Enthought-Media.jpg

media.py

Project Documentation



projectPlan v2.pdf
requirements v2.pdf
Team 7 Design.pdf
test plan v2.pdf
mediaPantherComp.dmg
mediaTigerComp.dmg

Link to this Page