PyALSoft
PyALSoft provides a function-oriented, managed playback API and typed bindings for
OpenAL Soft, including core OpenAL, ALC, EFX, and supported extensions. The
managed API lives at the package root; the complete low-level interface remains
available through pyalsoft.bindings.
PyALSoft is an independent project and is not affiliated with or endorsed by the OpenAL Soft project.
Installation
PyALSoft requires Python 3.12 or later.
python3 -m pip install pyalsoft
Quick start
play starts a WAV file immediately and returns an optional control handle:
import time
from pyalsoft import play
sound = play("sound.wav")
while sound.playing:
time.sleep(0.1)
Playback is asynchronous. If no control is needed, the return value can be ignored without stopping the sound:
play("notification.wav")
The returned PlayingSound has pause(), resume(), stop(), and
set_config() methods, plus playing, state, and status properties. The
convenience API supports uncompressed mono or stereo WAV files containing 8-bit
unsigned or 16-bit signed PCM. It opens its default audio session lazily, reuses
clips loaded from the same resolved path, and releases it automatically at
process exit. Applications can call shutdown() to close it earlier.
The complete example is available as examples/play_file.py
and can be run from a source checkout with:
uv run python examples/play_file.py
Explicit playback sessions
Applications that generate audio, stream it, select a device, or require fully explicit resource lifetimes can use the underlying managed API directly:
from pyalsoft import PCM, open_playback, play, release, upload
pcm = PCM(
# Half a second of mono silence; replace with your application's PCM bytes.
samples=b"\0\0" * 22_050,
channels=1,
sample_rate=44_100,
)
with open_playback() as playback:
clip = upload(playback, pcm)
voice = play(playback, clip)
# Query or control the voice here.
release(playback, voice)
release(playback, clip)
See examples/play_sine.py,
examples/move_sine.py, and
examples/stream_sine.py for complete explicit API
examples.
API layers
Automatically generated ctypes bindings for OpenAL live at
pyalsoft.bindings. Only experienced users should need them.
pyalsoft holds the hand authored Python API, intended to make working with the library more Pythonic and manageable.
Contributing
Direct development occurs on development, the base branch of the repository. Pull requests from there to master represent official releases, signified by a version increase in pyproject.toml. Version increases should only be done from development. If implementing your own feature, it is requested that you fork this repository and make your own feature branch, and then merge into development.
Create the locked development environment with uv:
uv sync --python 3.12
Before submitting a change, run the same core checks as CI:
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy
uv run python tools/generate_bindings.py --check
uv run python tools/sync_openal_soft.py --check
Bindings and docs/reference.md are generated from the
vendored OpenAL registry plus reviewed corrections in
tools/semantic_overrides.toml. After changing
the generator, registry, or overrides, regenerate them with:
uv run python tools/generate_bindings.py
See the repository tool guide for the purpose and structure of each development and release command.
License
PyALSoft's original Python code is available under the MIT License. Bundled OpenAL Soft and other third-party components remain under their respective licenses. The distribution includes the complete license texts and a third-party notice.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyalsoft-0.4.0.tar.gz.
File metadata
- Download URL: pyalsoft-0.4.0.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eae42ad6aad86772a3bcc04274d59ab09d4e280d70b6eac6168e22290f28aea
|
|
| MD5 |
8d08b5bb34894c52f7320e4c9ce00d40
|
|
| BLAKE2b-256 |
f420c41ec81de890dff300139a47efc7972b223633a6f6a3d9d6c8c29d76edab
|
File details
Details for the file pyalsoft-0.4.0-py3-none-win_amd64.whl.
File metadata
- Download URL: pyalsoft-0.4.0-py3-none-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82d1ba09881973922106a9ffdb30fcad732c016909b2e28ed61993709c796400
|
|
| MD5 |
e95e6ea6244eb149306e65b134e6ede6
|
|
| BLAKE2b-256 |
6caf56e259d531955909e2d65032a64ccf4f7d0d4fcd240d051f420a51c9171b
|
File details
Details for the file pyalsoft-0.4.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyalsoft-0.4.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff690bf0c13c7acd746415561d30110755252390ebc1c26747805a48cb45aeeb
|
|
| MD5 |
5958ab2acf63688499ec6d7c76454669
|
|
| BLAKE2b-256 |
0de95ebbd23bbd8f0fea8b8bd21705673761669bc5b10719a8251565f64d6ec0
|
File details
Details for the file pyalsoft-0.4.0-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyalsoft-0.4.0-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6942cab69bcee3dd4e0bda8b68746c49c0aea172f47b29faaa53158e12c7a830
|
|
| MD5 |
8e0d19d6efb4c8f9d62415df0fc30d7e
|
|
| BLAKE2b-256 |
1193111e7cc2c33b6fdaf6eda26ab58d3457d2f34bd8c7807c447ab77bd752f8
|
File details
Details for the file pyalsoft-0.4.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyalsoft-0.4.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 837.1 kB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab543eebae6e6e6ff860829a37a931dc7900a83cc9191992c89de2f3baea597a
|
|
| MD5 |
44d1fb39ab2d081c57d4d5e2e5603720
|
|
| BLAKE2b-256 |
0952dee0f1581fc4dd198bc57cf820bad44c7d0d3d8f4843b95897e8a3f358d8
|
File details
Details for the file pyalsoft-0.4.0-py3-none-macosx_10_13_x86_64.whl.
File metadata
- Download URL: pyalsoft-0.4.0-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 921.5 kB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f771e6426cad58f0f9ef49f4cfa8e5b301809a2fd4da4bc9f3ef23d9da24ea0
|
|
| MD5 |
4b56d458e78dacffcfac5ab0b93ec34c
|
|
| BLAKE2b-256 |
1d8ecfff927249f58d287c009063cd697289bc4e8962465f62f8721662c514e0
|