Revision 32 as of 2014-01-30 11:25:46

Clear message

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:

audioop

Manipulate raw audio data.

aifc

Read and write audio files in AIFF or AIFC format.

sunau

Provide an interface to the Sun AU sound format.

wave

Provide an interface to the WAV sound format.

chunk

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

sndhdr

Determine type of a sound file.

ossaudiodev

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

winsound

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

Nsound

C++ library with Python module for audio synthesis.

PyAudiere

A high-level audio interface for Python. (deadlink)

Pydub

A high-level audio interface for Python. Uses ffmpeg for formats other than WAVE

pyAudio

Python bindings for PortAudio audio input and output

Snack

Playback, recording, file and socket I/O, waveforms and spectrograms. "Last release 2004-12-01. Dead?"

Python Audio Tools

Programs for CD-ripping and conversion between audio file formats.

musicplayer module

Platform dependent

http://gstreamer.freedesktop.org/modules/gst-python.html

http://pyalsaaudio.sourceforge.net/

http://pypi.python.org/pypi/audiosocket/ - pure Python solution to play audio on Windows

Modules relying on closed source

pysonic


CategoryDocumentation

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