Differences between revisions 37 and 39 (spanning 2 versions)
Revision 37 as of 2015-12-09 13:30:24
Size: 3953
Comment: remove line breaks in "pysonic" paragraph
Revision 39 as of 2016-03-05 22:53:01
Size: 4379
Editor: JoeHamilton
Comment: added simpleaudio to platform-independent list
Deletions are marked like this. Additions are marked like this.
Line 55: Line 55:
||[[http://python-sounddevice.rtfd.org/|sounddevice]] ||This module provides bindings for the [[http://www.portaudio.com/|PortAudio]] library (using [[https://cffi.rtfd.org/|CFFI]]) and a few convenience functions to play and record [[http://www.numpy.org/|NumPy]] arrays containing audio signals. ||
|| [[http://simpleaudio.readthedocs.org/en/latest/|simpleaudio]] || Simple, dependency-free audio playback for Python 3 ||

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.


Conversions between colour systems.


Determine the type of a image file.


Determine the 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


C++ library with Python module for audio synthesis.


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


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


Python bindings for PortAudio audio input and output


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

Part of a music player. It uses FFmpeg for decoding and PortAudio for output. It supports gapless playback and high sample rates (96kHz or 192kHz). It also has the functionality to calculate the ReplayGain value and do loudness normalization, to calculate the AcoustId fingerprint, to get the metadata (via FFmpeg) and to calculate a visual representation for a sound file.


This module provides bindings for the PortAudio library (using CFFI) and a few convenience functions to play and record NumPy arrays containing audio signals.


Simple, dependency-free audio playback for Python 3

Platform dependent



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

Modules relying on closed source

pysonic - 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.