A cross-platform Python library for playing and recording audio with a focus on simplicity and no CPython extensions. Current version 0.4.6, released sporadically. Uses system audio APIs (ALSA/PulseAudio on Linux, CoreAudio on macOS, WASAPI on Windows). No external binaries required.
pip install soundcardNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Record 5 seconds of audio from the default microphone and play it back on the default speaker.
if mic is None: raise RuntimeError('No microphone found')Use a loop: for _ in range(10): data = mic.record(samplerate=44100, numframes=44100)
Use get_microphone(name='Device Name') or list all devices with sc.all_microphones()
name = 'Built-in Audio Analog Stereo'; mic = sc.get_microphone(name)
Replace callbacks with recorder = mic.record(…); speaker.play(…)
No dependency data recorded yet.