[Edu-sig] Python sound.

Dethe Elza dethe@burningtiger.com
Tue, 18 Dec 2001 10:28:19 -0800


Hi Rob,

I've had similar problems with a back-burner project.  I want a 
cross-platform way to create sounds based on a sine wave, but most of 
the python sound packages seem to be focussed on manipulation and 
playback of pre-recorded files (.wav, etc.).

Here are the options I'm aware of, for what it's worth:

Python Multimedia Services (part of standard install):
   Detect file type, manipulate raw audio data, but no playback
   http://www.python.org/doc/current/lib/mmedia.html

Snack Sound Toolkit
   Multi-platform, can create, filter, playback, and visualize sound 
files.  Some limited support for synthesizing sounds without playing a 
file.  Requires a Tk window to run it's loop (although I think the 
window can be hidden?)
   http://www.speech.kth.se/snack/

Pythonware Sound Toolkit
   Reads numerous sound formats (AU, VOC, and WAV) and plays them back 
on a variety of hardware platforms (windows and sun boxen).
  http://www.pythonware.com/products/pst/index.htm

ALPY 3D Sound Toolkit
   Interface to OpenAL (http://www.openal.org/home/), which is to audio 
what OpenGL is to graphics.  I haven't played with this yet, but it's on 
my list of things to do.
   http://amoras.2y.net/alpy/

pygame
   A game building framework built on top of SDL 
(http://www.libsdl.org/), which includes sound capabilities.  Another 
one I've been meaning to get around to trying. This appears to have more 
momentum (developers using it) than ALPY.
   http://pygame.seul.org/

There are also lots of special-purpose sound libraries for individual 
platforms (windows, linux, mac) and many (most?) have python bindings. 
It would be an interesting project to factor out the common features 
into one python package which worked cross platform and called the 
correct binary library depending on platform.  This isn't something I 
have time for right now, although I'd be willing to help document it on 
the Contagious Fun website.

If anyone knows of other options, or has experience they want to share 
about using any of the above, I'd be very interested in seeing it.

HTH

--Dethe

-- 

Dethe Elza (delza@burningtiger.com)
Chief Mad Scientist
Burning Tiger Technologies (http://burningtiger.com)
Living Code Weblog (http://livingcode.ca)