Differences between revisions 29 and 30
Revision 29 as of 2011-07-04 02:32:29
Size: 3019
Editor: eryksun
Comment: Added winsound to the built-in modules table.
Revision 30 as of 2011-08-24 07:50:50
Size: 3060
Editor: ssegvic
Comment: alsaaudio worked for me out of the box, while ossaudiodev did not
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:

Audio in Python

This page tries to provide a starting point for those who want to work with audio in combination with Python.

If you are creating a game, most of what you are looking for may already be included in the many PythonGameLibraries that are available.

If you are looking for podcasts related to Python, go to the PythonAudioMaterial page.

Built in modules

The Multimedia Services allow for some basic audio functionality in Python. It consists of the following modules:


Manipulate raw audio data.


Read and write audio files in AIFF or AIFC format.


Provide an interface to the Sun AU sound format.


Provide an interface to the WAV sound format.


Module to read IFF (e.g. AIFF) chunks.


Determine type of a sound file.


Access to OSS-compatible audio devices (mainly important for Linux / FreeBSD)


Access to the basic sound-playing machinery provided by Windows platforms.

Beyond the default modules

Alternatively, you might want to learn about audio programming in Python. There is a veritable forest of stuff out there, but here are some good starting points.

For a complete overview have a look at PythonInMusic.

Platform independent


  • A framework for audio synthesis.


  • A high-level audio interface for Python.


  • pyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. Only for audio input and output, other operations can be done using e.g. Python's built in wave module.


  • Snack has commands for basic sound handling, such as playback, recording, file and socket I/O. Snack also provides primitives for sound visualization, e.g. waveforms and spectrograms.

Python Audio Tools

  • Python programs for CD-ripping and conversion between audio file formats.

Platform dependent



Modules relying on closed source


  • A wrapper around the FMOD-library offering plenty of options including 3D sound and effects. FMOD is a popular closed, but free for own use, that is used in many commercial game titles.


Audio (last edited 2016-03-05 22:53:01 by JoeHamilton)

Unable to edit the page? See the FrontPage for instructions.