Differences between revisions 16 and 39 (spanning 23 versions)
Revision 16 as of 2007-11-23 15:19:41
Size: 4786
Editor: neo-y1a
Comment:
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 1: Line 1:
= Audio in python = = Audio in Python =
Line 3: Line 3:
This page tries to provide a starting point for those who want to work with audio in combination with python. If you are looking for podcast and such on Python you are not at the right place here, but PythonAudioMaterial is. If you are creating a game, most of what you are looking for may already be included in the many [PythonGameLibraries game libraries] that are available for 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|PythonGameLibraries]] that are available.


If you are looking for podcasts related to Python, go to the [[PythonAudioMaterial|PythonAudioMaterial]] page.
Line 7: Line 15:
The [http://docs.python.org/lib/mmedia.html Multimedia Services] allow for some basic audio functionality in python. It consists of the following modules:
The [[http://docs.python.org/3/library/mm.html|Multimedia Services]] allow for some basic audio functionality in Python. It consists of the following modules:
Line 10: Line 19:
---- /!\ '''Edit conflict - other version:''' ----
[http://docs.python.org/lib/module-audioop.html audioop]
   Manipulate raw audio data.
[http://docs.python.org/lib/module-aifc.html aifc]
   Read and write audio files in AIFF or AIFC format.
[http://docs.python.org/lib/module-sunau.html sunau]
   Provide an interface to the Sun AU sound format.
[http://docs.python.org/lib/module-wave.html wave]
   Provide an interface to the WAV sound format.
[http://docs.python.org/lib/module-chunk.html chunk]
   Module to read IFF (e.g. AIFF) chunks.
[http://docs.python.org/lib/module-sndhdr.html sndhdr]
   Determine type of a sound file.
[http://docs.python.org/lib/module-ossaudiodev.html ossaudiodev]
   Access to OSS-compatible audio devices (mainly important for Linux / FreeBSD)
Line 26: Line 20:
---- /!\ '''Edit conflict - your version:''' ----
[http://docs.python.org/lib/module-audioop.html audioop]
   Manipulate raw audio data.
[http://docs.python.org/lib/module-aifc.html aifc]
   
Read and write audio files in AIFF or AIFC format.
[http://docs.python.org/lib/module-sunau.html sunau]
   
Provide an interface to the Sun AU sound format.
[http://docs.python.org/lib/module-wave.html wave]
   
Provide an interface to the WAV sound format.
[http://docs.python.org/lib/module-chunk.html chunk]
   
Module to read IFF (e.g. AIFF) chunks.
[http://docs.python.org/lib/module-sndhdr.html sndhdr]
   Determine type of a sound file.
[http://docs.python.org/lib/module-ossaudiodev.html ossaudiodev]
   
Access to OSS-compatible audio devices (mainly important for Linux / FreeBSD)
||[[http://docs.python.org/3/library/audioop.html|audioop]] ||Manipulate raw audio data. ||
||[[http://docs.python.org/3/library/aifc.html|aifc]] ||Read and write audio files in AIFF or AIFC format. ||
||[[http://docs.python.org/3/library/sunau.html|sunau]] ||Provide an interface to the Sun AU sound format. ||
||[[http://docs.python.org/3/library/wave.html|wave]] ||Provide an interface to the WAV sound format. ||
||[[http://docs.python.org/3/library/chunk.html|chunk]] ||Module to read IFF (e.g. AIFF) chunks. ||
||[[http://docs.python.org/3/library/chunk.html|colorsys]] ||Conversions between colour systems. ||
||[[http://docs.python.org/3/library/chunk.html|imghdr]] ||Determine the type of a image file. ||
||[[http://docs.python.org/3/library/sndhdr.html|sndhdr]] ||Determine the type of a sound file. ||
||[[http://docs.python.org/3/library/
ossaudiodev.html|ossaudiodev]] ||Access to OSS-compatible audio devices (mainly important for Linux / FreeBSD) ||
||[[http://docs.python.org/3/library/winsound.html|winsound]] ||Access to the basic sound-playing machinery provided by Windows platforms. ||
Line 42: Line 31:
---- /!\ '''End of edit conflict''' ----

Line 45: Line 36:
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.
Line 47: Line 37:
For a complete overview have a look at PythonInMusic.
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|PythonInMusic]].
Line 52: Line 47:
---- /!\ '''Edit conflict - other version:''' ----
[http://people.csail.mit.edu/hubert/pyaudio/ pyAudio]
   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.
Line 56: Line 48:
[http://www.speech.kth.se/snack/ Snack]
   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.
||[[http://nsound.sourceforge.net|Nsound]] ||C++ library with Python module for audio synthesis. ||
||[[http://pypi.python.org/pypi/pyaudiere/0.2|PyAudiere]] ||A high-level audio interface for Python. (deadlink) ||
||[[http://pydub.com|Pydub]] ||A high-level audio interface for Python. Uses ffmpeg for formats other than WAVE ||
||[[http://people.csail.mit.edu/hubert/pyaudio/|pyAudio]] ||Python bindings for [[PortAudio|PortAudio]] audio input and output ||
||[[http://www.speech.kth.se/snack/|Snack]] ||Playback, recording, file and socket I/O, waveforms and spectrograms. "Last release 2004-12-01. Dead?" ||
||[[http://sourceforge.net/projects/audiotools/|Python Audio Tools]] ||Programs for CD-ripping and conversion between audio file formats. ||
||[[https://pypi.python.org/pypi/musicplayer|musicplayer module]] ||Part of a [[http://albertz.github.com/music-player/|music player]]. It uses FFmpeg for decoding and [[PortAudio|PortAudio]] for output. It supports gapless playback and high sample rates (96kHz or 192kHz). It also has the functionality to calculate the [[ReplayGain|ReplayGain]] value and do loudness normalization, to calculate the [[AcoustId|AcoustId]] fingerprint, to get the metadata (via FFmpeg) and to calculate a visual representation for a sound file. ||
||[[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 ||
Line 59: Line 58:
[http://sourceforge.net/projects/audiotools/ Python Audio Tools]
   Python Audio Tools
Line 63: Line 61:
[http://gstreamer.freedesktop.org/modules/gst-python.html]
Line 65: Line 62:
---- /!\ '''Edit conflict - your version:''' ----
[http://people.csail.mit.edu/hubert/pyaudio/ pyAudio]
   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.
Line 69: Line 63:
[http://www.speech.kth.se/snack/ Snack]
   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.
http://gstreamer.freedesktop.org/modules/gst-python.html
Line 72: Line 65:
[http://sourceforge.net/projects/audiotools/ Python Audio Tools]
   Python Audio Tools
Line 75: Line 66:
=== Platform dependent ===
[http://gstreamer.freedesktop.org/modules/gst-python.html]
http://pyalsaaudio.sourceforge.net/
Line 78: Line 68:
---- /!\ '''End of edit conflict''' ----
http://pypi.python.org/pypi/audiosocket/ - pure Python solution to play audio on Windows
Line 83: Line 75:
---- /!\ '''Edit conflict - other version:''' ----
[http://pysonic.sourceforge.net/index.html pysonic]
   A wrapper around the [http://www.fmod.org
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.
[[http://pysonic.sourceforge.net/|pysonic]] - A wrapper around the [[http://www.fmod.org|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.


Line 87: Line 80:
CategoryDocumentation
Line 89: Line 81:
---- /!\ '''Edit conflict - your version:''' ----
[http://pysonic.sourceforge.net/index.html pysonic]
   A wrapper around the [http://www.fmod.org 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.
----
CategoryDocumentation

---- /!\ '''End of edit conflict''' ----
[[CategoryDocumentation|CategoryDocumentation]]

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.

colorsys

Conversions between colour systems.

imghdr

Determine the type of a image file.

sndhdr

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

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.

sounddevice

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

simpleaudio

Simple, dependency-free audio playback for Python 3

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


CategoryDocumentation

Audio (last edited 2022-02-11 15:26:49 by mytja)

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