Skip to main content

PyALSoft

CI status PyPI version Supported Python versions

OpenAL Soft 1.25.2

PyALSoft provides a functional, 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

This example generates a 440 Hz sine wave, plays it, and releases every native resource when the with block exits:

import math
import time
from array import array

from pyalsoft import (
    PCM,
    VoiceState,
    get_voice_status,
    open_playback,
    play,
    release,
    upload,
)

sample_rate = 44_100
duration = 0.5
pcm = array(
    "h",
    (
        round(((1 << 14) - 1) * math.sin(math.tau * 440 * frame / sample_rate))
        for frame in range(round(sample_rate * duration))
    ),
).tobytes()

audio = PCM(samples=pcm, channels=1, sample_rate=sample_rate)

with open_playback() as playback:
    clip = upload(playback, audio)
    voice = play(playback, clip)
    while get_voice_status(playback, voice).state is VoiceState.PLAYING:
        time.sleep(0.01)
    release(playback, voice)
    release(playback, clip)

The same example is available as examples/play_sine.py and can be run from a source checkout with:

uv run python examples/play_sine.py

API layers

Automatically generated, CType bindings of OpenAL live at pyalsoft.bindings. Only experienced users should touch these. Most users can pretend they do not exist.

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

pyalsoft-0.3.0.tar.gz (2.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyalsoft-0.3.0-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

pyalsoft-0.3.0-py3-none-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pyalsoft-0.3.0-py3-none-manylinux_2_28_aarch64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

pyalsoft-0.3.0-py3-none-macosx_11_0_arm64.whl (834.7 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

pyalsoft-0.3.0-py3-none-macosx_10_13_x86_64.whl (919.1 kB view details)

Uploaded Python 3macOS 10.13+ x86-64

File details

Details for the file pyalsoft-0.3.0.tar.gz.

File metadata

  • Download URL: pyalsoft-0.3.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

Hashes for pyalsoft-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5e0c11f524df7323788d5cba7c42c8b98c738f58204fa805e7d6fee32d9b5a72
MD5 2ca8fb0a10e032cdcf28a1fea670ae90
BLAKE2b-256 6d7ba7b4ec7cf0f1cb6435b12c1589457b3ca72871483d4f735e28efa4941e50

See more details on using hashes here.

File details

Details for the file pyalsoft-0.3.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyalsoft-0.3.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

Hashes for pyalsoft-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cdd04b71a72a8ffb9f10d470f91affbf2a885b122585d8e4abae882a3351172e
MD5 588277cd7ecdd0d27e6519a914f5501b
BLAKE2b-256 cf01a6faec72a5d36cdc0e1813f2e00dc175cbaf7b2e6c4c144aafbbfb535d64

See more details on using hashes here.

File details

Details for the file pyalsoft-0.3.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: pyalsoft-0.3.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

Hashes for pyalsoft-0.3.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eb946774c79389c3c99f801033a316f6ac6e251e301f70a7933941c7b6567f4b
MD5 45c4634e89c79fc2a7511eb2769470d4
BLAKE2b-256 90e7dd3ba65e6aef4e62bf9ad9182c4e07732bb70e849eec280552e5a680bd40

See more details on using hashes here.

File details

Details for the file pyalsoft-0.3.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: pyalsoft-0.3.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

Hashes for pyalsoft-0.3.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7e7301159c25001455888e7941021aff3bf690e012799670e479e8cb6dbd66f3
MD5 c439a49f3be7054d06002b8e56ee919f
BLAKE2b-256 5977cded5f7259b5c7db31289634122c8c09144c9ba863a129b71722e378115c

See more details on using hashes here.

File details

Details for the file pyalsoft-0.3.0-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pyalsoft-0.3.0-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 834.7 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

Hashes for pyalsoft-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 906b5628e6f3b8bb53e2fc9004c65a4759648652c330af69625f05ef185a0fe2
MD5 10daeace8d19e08681318d5f6fbc5a1f
BLAKE2b-256 1374c830b9968a207a6197b73dc6caab4792388c4a32e7f0f751ef7a4c718ad1

See more details on using hashes here.

File details

Details for the file pyalsoft-0.3.0-py3-none-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: pyalsoft-0.3.0-py3-none-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 919.1 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

Hashes for pyalsoft-0.3.0-py3-none-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d2e31678b127f83c24744ca033aee441b99ab2d1633ce265cca06717c7bbad41
MD5 5c02cba6d27fe3adca685c1ed0d6ce36
BLAKE2b-256 cd1ca196bfe3ad1a5a1e35bf607164afa436a465d5df2ce037715fe939810756

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page