skillfed

pycaw

Python Core Audio Windows Library

pycaw v20251023 175.7K downloads/30d#10,263 on PyPI443
License unclear Active released

What it is and what it does

Pycaw is a Windows-only Python library that exposes the Windows Core Audio API for programmatic control of audio devices and sessions. It lets you query audio devices, read and set volume levels (in decibels), check mute state, and manage sound device properties directly from Python code. The library wraps low-level COM interfaces through comtypes and relies on psutil for system integration.

Typical use cases include building audio control panels, automating volume adjustments in applications, monitoring audio device state, or integrating audio management into larger Windows automation scripts. Because it is Windows-specific and built on COM interfaces, it has no equivalents on macOS or Linux and is not portable across platforms.

Use it for:

  • Automate volume control in Windows desktop applications or scripts without user interaction
  • Query and monitor the state of audio devices and sessions for diagnostics or logging
  • Build custom audio control interfaces or dashboards that interact with Windows speakers and microphones
  • Integrate audio device management into Windows system automation or testing workflows

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Pycaw provides programmatic control of Windows audio devices, sessions, and volume levels through Python bindings to the Windows Core Audio API.

Yes, if you are building Windows-only audio control features and need programmatic access to Core Audio APIs. The package is actively maintained, has low install friction, and no known vulnerabilities. The main caveat is the unclear license—verify the repository's license terms before use. Not suitable for cross-platform projects.

Install

pycaw on PyPI

pip

pip install pycaw

uv

uv add pycaw

poetry

poetry add pycaw

Installing pycaw

Before you install

Installation is straightforward with low friction; the package depends on comtypes and psutil, both stable and widely available. Maintenance is active with a recent release (295 days ago) and ongoing commits.

License in practice

License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms in the repository before use in proprietary or restricted projects.

Quickstart

pip install pycaw

from pycaw.pycaw import AudioUtilities
device = AudioUtilities.GetSpeakers()
volume = device.EndpointVolume
print(f"Volume level: {volume.GetMasterVolumeLevel()} dB")
volume.SetMasterVolumeLevel(-20.0, None)

Windows-only; requires Visual C++ build tools (e.g., via `choco install visualcpp-build-tools`). Not supported on macOS or Linux.

Verify before relying

  • Exact Python version support (requires_python is unspecified in metadata)
  • Whether comtypes and psutil are automatically installed or must be pre-installed
  • Full scope of audio session and device management beyond volume control

Package facts

License not declared (unclear)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — comtypes, psutil
Maintenance actively maintained — 295 days since the last release
Last repo commit
First released
Downloads 175,658/month — #10,263 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pycaw-20251023-py3-none-any.whl

Tags

windows audio control pythonvolume control windowsaudio device management windowscore audio windows apispeaker mute volume pythonaudio session controlwindows sound device python
windows-onlyaudio-controlcom-wrapper

More Utilities packages