Metadata-Version: 2.4
Name: winappaudiorouter
Version: 1.0.0
Summary: Route Windows app audio output devices using the same policy API path as EarTrumpet.
Home-page: https://github.com/rostok2112/winappaudiorouter
Author: winappaudiorouter contributors
License: MIT
Project-URL: Homepage, https://github.com/rostok2112/winappaudiorouter
Project-URL: Repository, https://github.com/rostok2112/winappaudiorouter
Project-URL: Issues, https://github.com/rostok2112/winappaudiorouter/issues
Keywords: windows,audio,routing,pycaw,eartrumpet
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: comtypes>=1.4.6
Requires-Dist: psutil>=5.9
Requires-Dist: pycaw>=20240210
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == "dev"
Requires-Dist: pytest>=8.3; extra == "dev"
Requires-Dist: twine>=6.1; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# winappaudiorouter

`winappaudiorouter` is a Python library for changing output audio devices per app on Windows, without requiring external tools. It follows the same Windows routing path used by EarTrumpet/SoundVolumeView:
`Windows.Media.Internal.AudioPolicyConfig::SetPersistedDefaultAudioEndpoint`.

## Features

- Enumerate active output devices.
- Enumerate active app audio sessions.
- Route one app PID (or all active sessions by process name) to a target output.
- Clear persisted app routing (return to system default).
- CLI + Python API.

## Installation

```powershell
pip install winappaudiorouter
```

For local development:

```powershell
pip install -e .[dev]
```

## CLI Usage

```powershell
winappaudiorouter list-devices
winappaudiorouter list-sessions
winappaudiorouter route --process-name chrome.exe --device "Headphones"
winappaudiorouter route --pid 1234 --device "{0.0.0.00000000}.{GUID}"
winappaudiorouter clear --process-name chrome.exe
winappaudiorouter get --pid 1234
```

## Python Usage

```python
import winappaudiorouter as war

devices = war.list_output_devices()
sessions = war.list_app_sessions()

war.set_app_output_device(process_name="chrome.exe", device="Headphones")
war.clear_app_output_device(process_name="chrome.exe")
```

## Running tests

```powershell
python -m pytest -q
```

## CI and PyPI publish

- CI tests/build run on push and pull requests.
- PyPI publish workflow runs on tag pushes like `v1.0.1`.
- GitHub repo secret required: `PYPI_API_TOKEN`.

## Contribution guidelines

Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.

## License

This project is licensed under the MIT License. See [LICENSE](LICENSE).

## Limitations

- Windows 10 1803+ only.
- `process_name` routing requires at least one active audio session for that app.
- Session re-binding can be asynchronous; some apps require playback restart.
