This directory provides usage examples for the ProcTap library.
This directory contains practical examples of per-process audio capture using ProcTap across different platforms. Each sample demonstrates platform-specific usage patterns.
- windows_basic.py: Windows per-process audio capture example
- linux_basic.py: Linux PulseAudio capture example (experimental)
- macos_basic.py: macOS Core Audio Process Tap example (experimental)
- OS: Windows 10 (20H1 or later) or Windows 11
- Python: 3.10 or higher
- Permissions: No administrator privileges required
- OS: Linux with PulseAudio or PipeWire
- Python: 3.10 or higher
- System Package:
pulseaudio-utils(providespareccommand)
- OS: macOS 14.4 (Sonoma) or later
- Python: 3.10 or higher
- Swift Helper: Built automatically during installation
# From PyPI (recommended)
pip install proc-tap
# From source (for development)
git clone https://github.com/m96-chan/ProcTap
cd ProcTap
pip install -e .pip install psutilThis example captures audio from a specific process and saves it to a WAV file. You can specify either a process ID or process name to record the audio output from that process.
- Specify target process by process ID (
--pid) or process name (--name) - Save captured audio to a WAV file
- Stop recording with Enter key or Ctrl+C
- Records in 44.1kHz, stereo, 16-bit PCM format
python examples/windows_basic.py [--pid PID | --name PROCESS_NAME] [--output OUTPUT_FILE]| Option | Type | Required | Description |
|---|---|---|---|
--pid |
Integer | Yes* | Process ID to capture |
--name |
String | Yes* | Process name to capture (e.g., "VRChat.exe" or "VRChat") |
--output |
String | No | Output WAV file path (default: "output.wav") |
* Either --pid or --name is required.
# Record audio from VRChat
python examples/windows_basic.py --name "VRChat.exe" --output vrchat_audio.wav
# Record audio from Discord (works without .exe extension)
python examples/windows_basic.py --name "Discord" --output discord_audio.wav
# Use default output filename (output.wav)
python examples/windows_basic.py --name "spotify.exe"# Record from process with PID 1234
python examples/windows_basic.py --pid 1234 --output audio.wav- Open Task Manager with
Ctrl + Shift + Esc - Click the "Details" tab
- Check the "PID" column for the target process
# Display all processes
tasklist
# Search for a specific process name
tasklist | findstr "VRChat"Using the --name option eliminates the need to look up the PID.
Specifications of the recorded WAV file:
- Format: WAV (PCM)
- Sample Rate: 44,100 Hz (CD quality)
- Channels: 2 (stereo)
- Bit Depth: 16-bit
- Encoding: Linear PCM
To stop recording:
- Press Enter key, or
- Press Ctrl + C
The WAV file will be saved when recording stops.
Cause: ProcTap is not installed.
Solution:
cd /path/to/ProcTap
pip install -e .Cause: psutil is not installed.
Solution:
pip install psutilCause: The specified process name is not running.
Solution:
- Verify the process name is correct
- Ensure the application is running
- Use
tasklistcommand to find the exact process name
Cause: C++ extension has not been built.
Solution:
# Rebuild the C++ extension
pip install -e . --force-reinstall --no-depsNote: ProcTap requires the native C++ extension. Ensure Visual Studio Build Tools and Windows SDK are installed.
Things to Check:
- Verify the target process is actually playing audio
- Ensure Windows 10 is version 20H1 or later (check with
winvercommand) - Verify the process ID or name is correct
- Games: VRChat, Discord, general gaming applications
- Media Players: Spotify, foobar2000, MusicBee
- Communication Apps: Discord, Zoom, Teams
- Browsers: Chrome, Firefox, Edge (per-tab processes)
- Capture audio from specific applications only, not the entire system
- Record only the desired audio even when multiple applications are playing sound
- No administrator privileges required
- Windows: Requires Windows 10 20H1 or later for per-process WASAPI capture
- Linux: Experimental - currently captures from sink monitor (may include other apps)
- macOS: Experimental - requires macOS 14.4+ for Core Audio Process Tap API
- Bug Reports: GitHub Issues
- Documentation: README.md in the project root
- API Details: CLAUDE.md