Skip to main content

Pycaw (Python Core Audio Windows)

Tests Coverage Status PyPI release PyPI version Documentation

Pycaw is a Python library designed exclusively for controlling audio devices on Windows systems. It allows programmatic access to audio sessions, volume control, and sound device management on the Windows platform.

Note: Pycaw does not support macOS or Linux. It is built specifically for Windows using Core Audio APIs. If you're looking for similar functionality on other platforms, you'll need alternative libraries.

Pycaw currently supports Python 3.10 through 3.14 on Windows. Supported Python versions are stable, non-EOL releases that have passed the project's Windows test matrix; newer Python releases are added after compatibility validation.

Install

Latest stable release:

pip install pycaw

Development branch:

pip install https://github.com/AndreMiras/pycaw/archive/main.zip

System requirements:

choco install visualcpp-build-tools

Usage

from pycaw.pycaw import AudioUtilities
device = AudioUtilities.GetSpeakers()
volume = device.EndpointVolume
print(f"Audio output: {device.FriendlyName}")
print(f"- Muted: {bool(volume.GetMute())}")
print(f"- Volume level: {volume.GetMasterVolumeLevel()} dB")
print(f"- Volume range: {volume.GetVolumeRange()[0]} dB - {volume.GetVolumeRange()[1]} dB")
volume.SetMasterVolumeLevel(-20.0, None)
# or work with the 0-100 scale the Windows volume mixer uses:
print(f"- Volume: {device.volume_percent:.0f}%")
device.volume_percent = 50

See more in the examples directory or visit the documentation.

Tests

Create the locked contributor environment and run the compatibility suite. uv uses .python-version to install/select Python 3.14 and supplies reproducible tools; Tox handles compatibility isolation.

uv sync --locked
uv run tox

Tox remains responsible for isolating the Python 3.10-3.14 minimum/current dependency matrix. To run one interpreter's lanes, use for example:

uv run tox -e py314-minimum,py314-current

Documentation and release tools are opt-in groups:

uv sync --locked --no-default-groups --group docs
uv run --no-sync sphinx-build -M html docs/source docs/_build

uv sync --locked --only-group release
uv run --no-sync python -m build
uv run --no-sync python -m twine check dist/*

Check or apply Ruff through the locked Tox environments:

uv run tox -e lint-check
uv run tox -e lint-format

Maintainers with a separately installed Tox and the tox-uv plugin can still run the equivalent tox commands directly. See the tests directory for the test suite.

The dependency files serve distinct purposes. [project].dependencies in pyproject.toml declares inclusive lower bounds for consumers; requirements.txt exactly pins the supported minimum test lane; Tox's current lane deliberately resolves the newest runtime dependencies; and uv.lock reproduces normal contributor tools. The lock supplements rather than replaces the minimum/current compatibility matrix.

Metadata

Release files for pycaw 20260927

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycaw 20260927
File Size Uploaded
pycaw-20260927.tar.gz 29.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycaw 20260927
File Interpreter ABI Platform
pycaw-20260927-py3-none-any.whl Python 3 none any Details

Total release size: 58.1 kB

Release files / pycaw-20260927.tar.gz

Download URL pycaw-20260927.tar.gz
Size 29.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3a833ace1a76d0cee134366366d64c56ea9552ebc6f572580e4299ad552743f6
BLAKE2b-256 checksum
How to use checksums
9e512870619bf47cef359505d88d277b71c18ae5af18ffe94e707dbce6def6c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pycaw-20260927-py3-none-any.whl

Download URL pycaw-20260927-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5b162a87536956af8dfa0fc53b1c77870a30706445ffd7f92a2ed184f65ddf4
BLAKE2b-256 checksum
How to use checksums
af79baf93a0a0b53a886f6a84ac05dd8491068c8a7c54db4ccd247acdcff9d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

20260927 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page