skillfed

SoundCard

Play and record audio without resorting to CPython extensions

soundcard v0.4.6 126.2K downloads/30d#11,786 on PyPI763
Permissive license BSD 3-clause Active released

What it is and what it does

SoundCard is a Python library for audio input and output that wraps the native audio APIs of Linux (PulseAudio), macOS (CoreAudio), and Windows (WASAPI) without requiring compiled C extensions. It exposes a unified interface for discovering, selecting, and controlling speakers and microphones, and handles audio data as NumPy arrays scaled to 0dBFS (Full Scale). The library supports both one-shot recording and playback as well as continuous streaming via Recorder and Player context managers.

The package is designed for developers who need cross-platform audio I/O without the complexity of lower-level audio frameworks or the overhead of CPython extensions. It handles channel mapping, sample rate configuration, and latency tuning through blocksize parameters. The library is actively maintained, supports current Python versions, and carries no known security vulnerabilities, though it remains a hobby project and response times to issues may vary.

Use it for:

  • Record audio from a microphone and play it back through speakers in real-time or batch mode.
  • Build a voice assistant or audio processing pipeline that captures input from a specific microphone by name.
  • Stream audio continuously from a multi-channel professional sound card using channel maps.
  • Implement low-latency audio applications by tuning blocksize and numframes parameters.
  • Discover and enumerate available audio devices on a user's system for dynamic device selection.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

SoundCard plays and records audio across Linux, macOS, and Windows using native OS audio libraries (PulseAudio, CoreAudio, WASAPI) without C extensions, exposing a unified Python interface for speaker and microphone access.

Yes. SoundCard is a solid choice for cross-platform audio I/O in Python. It has low install friction (pure Python, two lightweight dependencies), active maintenance, permissive licensing, no known vulnerabilities, and a clear, documented API. Install it if you need speaker/microphone access without C extension overhead. Be aware that it is a hobby project—response to issues is not guaranteed to be timely—and that latency and device behavior can vary across platforms and hardware.

Install

soundcard on PyPI

pip

pip install soundcard

uv

uv add soundcard

poetry

poetry add soundcard

Installing SoundCard

Before you install

Low friction: pure Python wheel with only numpy and cffi as runtime dependencies. Active maintenance—last commit 2026-06-17, 124 days since latest release. Repository has 763 stars and is not archived, suggesting stable ongoing support.

License in practice

BSD 3-clause is permissive; you may use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice and disclaimer.

Quickstart

pip install soundcard

import soundcard as sc
import numpy

# Record one second of audio
default_mic = sc.default_microphone()
data = default_mic.record(samplerate=48000, numframes=48000)

# Play back the recorded audio
default_speaker = sc.default_speaker()
default_speaker.play(data / numpy.max(numpy.abs(data)), samplerate=48000)

Requires Python 3.5 or later. On Linux, PulseAudio or compatible audio system must be available; on macOS, CoreAudio; on Windows, WASAPI. Audio data must be normalized between -1 and 1 to avoid clipping.

Verify before relying

  • Whether latency tuning via blocksize and numframes parameters meets real-time or low-latency application requirements in practice.
  • Support status for less common sound cards or multi-channel professional audio interfaces beyond the documented examples.
  • Whether the experimental exclusive_mode flag on Windows/WASAPI is production-ready or still carries stability risks.

Package facts

License BSD 3-clause (permissive)
Python support supports the current Python release (>=3.5)
Install friction low — pure-Python wheel
Runtime dependencies 2 — numpy, cffi
Maintenance actively maintained — 124 days since the last release
Last repo commit
First released
Downloads 126,196/month — #11,786 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: soundcard-0.4.6-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Multimedia :: Sound/Audio :: Capture/RecordingTopic :: Multimedia :: Sound/Audio :: Players

Tags

audio playback and recordingcross-platform sound card accessmicrophone input capturespeaker output controllow-latency audio streamingCFFI audio librarynative audio backend wrapper
audio-iocross-platformreal-time-audio

More Players packages