PyAudio
Cross-platform audio I/O with PortAudio
What it is and what it does
PyAudio wraps PortAudio v19, a cross-platform audio I/O library, to let you record from and play to audio devices in Python. It abstracts away platform-specific audio APIs—Windows MME, DirectSound, WASAPI, and WDM-KS on Windows; Core Audio on macOS; and ALSA or OSS on GNU/Linux—so you can write audio code once and run it on multiple operating systems.
The package has no runtime dependencies beyond PortAudio itself, which must be installed separately on macOS and GNU/Linux. Installation is straightforward on Windows via pip, but requires prior system setup on Unix-like platforms. The project is in Beta status and has not been updated recently, so it is stable but not actively developed.
Use it for:
- Record audio from a microphone or line input for speech recognition, music analysis, or audio logging applications.
- Play back audio files or generated sound in real-time applications such as games, synthesizers, or notification systems.
- Build cross-platform audio processing pipelines that capture, process, and output audio without rewriting for each OS.
- Prototype audio I/O functionality in Python before moving to lower-level APIs or compiled languages.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyAudio provides Python bindings for PortAudio v19, enabling you to play and record audio on Windows, macOS, and GNU/Linux from Python code.
Yes, if you need straightforward cross-platform audio I/O in Python and are willing to handle platform-specific setup (Homebrew on macOS, system packages on Linux). The package is stable, permissively licensed, and has no known vulnerabilities. Install friction is moderate but manageable. Be aware that the project is dormant and unlikely to receive updates; if you need active maintenance or ASIO support on Windows, consider alternatives.
Install
pyaudio on PyPI
pip
pip install pyaudiouv
uv add pyaudiopoetry
poetry add pyaudioInstalling PyAudio
Before you install
Medium install friction: precompiled wheels exist for Windows across multiple Python versions, but macOS requires Homebrew to install portaudio first, and GNU/Linux requires system packages or building from source with development libraries.
License in practice
MIT license is permissive; you can use, modify, and distribute PyAudio with minimal restrictions, provided you include the license notice.
Quickstart
pip install pyaudio
import pyaudio
p = pyaudio.PyAudio()
print(p.get_device_count())
On macOS, install portaudio via Homebrew first: brew install portaudio. On GNU/Linux, install portaudio19 development libraries and python3 headers via your package manager before pip install.
Verify before relying
- Whether ASIO support is available on Windows via custom builds, given the standard distribution does not include it.
- Current maintenance trajectory and likelihood of future updates given dormant status.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,011 days since the last release |
| First released | |
| Downloads | 1,335,110/month — #4,037 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: PyAudio-0.2.14-cp310-cp310-win32.whl; PyAudio-0.2.14-cp310-cp310-win_amd64.whl; PyAudio-0.2.14-cp311-cp311-win32.whl; PyAudio-0.2.14-cp311-cp311-win_amd64.whl; PyAudio-0.2.14-cp312-cp312-win32.whl; PyAudio-0.2.14-cp312-cp312-win_amd64.whl; PyAudio-0.2.14-cp313-cp313-win32.whl; PyAudio-0.2.14-cp313-cp313-win_amd64.whl; PyAudio-0.2.14-cp38-cp38-win32.whl; PyAudio-0.2.14-cp38-cp38-win_amd64.whl; PyAudio-0.2.14-cp39-cp39-win32.whl; PyAudio-0.2.14-cp39-cp39-win_amd64.whl
Tags
More Sound/Audio packages
Reads and writes audio files in formats like…
permissive · top 1,000 on PyPI
pydubPydub provides a high-level Python interface…
permissive · top 5,000 on PyPI
mutagenMutagen reads and writes audio metadata (tags)…
copyleft · top 5,000 on PyPI
torchaudioProvides PyTorch-based audio processing,…
permissive · top 5,000 on PyPI
moviepyMoviePy is a Python library for video editing…
permissive · top 5,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
pyfmodexPyfmodex provides Python bindings to the FMOD…
permissive · top 15,000 on PyPI
SoundCardSoundCard plays and records audio across Linux,…
permissive · top 15,000 on PyPI
playsoundPlays audio files (MP3, WAV) and URLs from…
permissive · top 15,000 on PyPI
miniaudioMiniaudio provides Python bindings for…
permissive · top 15,000 on PyPI
pycawPycaw provides programmatic control of Windows…
unclear · top 15,000 on PyPI
types-pyaudioProvides type hints for the pyaudio library,…
permissive · top 15,000 on PyPI
pyobjc-framework-SoundAnalysisProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI
fmod-toolkitExtracts and exports audio from FMOD sound bank…
permissive · top 15,000 on PyPI