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.

Install

Latest stable release:

pip install pycaw

Development branch:

pip install https://github.com/AndreMiras/pycaw/archive/develop.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

See in the tests directory.

Metadata

Release files for pycaw 20260921

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 20260921
File Size Uploaded
pycaw-20260921.tar.gz 27.4 kB Details

Built distribution (wheel)

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

Total release size: 54.9 kB

Release files / pycaw-20260921.tar.gz

Download URL pycaw-20260921.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
48decedfbb5e0654d983b6b1876b4cef14dbfe62c943d7c8d8370fe343f95901
BLAKE2b-256 checksum
How to use checksums
35a349077ccfeddd0d6bcd05a384792b19df34d840dbf6ca7f306c4e312a2fb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

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

Download URL pycaw-20260921-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f75128111d99195e5fe4f08f0bbd36d36cede1b339c6a8441f81bfd19379571d
BLAKE2b-256 checksum
How to use checksums
9fa13ef4af478c1766a964b71447719146a2289d2969368fd40f48e31b6016d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

20260921 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