Skip to content

PyALSoft

PyALSoft provides a function-oriented audio API for common playback and recording tasks, along with typed low-level OpenAL Soft bindings. Wheels include the native OpenAL Soft runtime and static-audio decoder, so separate native installations are not normally required.

Installation

PyALSoft requires Python 3.12 or later. Install it from PyPI:

python -m pip install pyalsoft

Play an audio file

play() begins playback immediately and returns a PlayingSound handle:

from pyalsoft import play

sound = play("sound.wav")
sound.wait()

WAV, FLAC, MP3, and Ogg Vorbis assets are detected from their contents, so the filename extension does not control decoding.

Playback is asynchronous. If you do not need to control the sound, you can ignore the return value without stopping playback:

play("notification.wav")

Documentation

Complete runnable programs are available in the examples directory.