Automatically optimize audio processing performance by setting process priority and CPU affinity for Voicemeeter and Windows Audiodg service.
This PowerShell script optimizes audio performance on Windows by automatically:
- Starting Voicemeeter if not already running
- Setting process priority to High for both Voicemeeter and Audiodg
- Pinning both processes to CPU Core 0 for consistent performance
- Displaying detailed status notifications with visual feedback
Tested on: Windows 10 & 11 with PowerShell 3.0+
- Features
- System Requirements
- Installation
- Usage
- Configuration
- Important Notes
- Troubleshooting
- Advanced Options
- Contributing
- License
β Dual Process Management
- Automatically detects and configures Voicemeeter
- Optimizes Windows Audiodg.exe service simultaneously
- Auto-starts Voicemeeter if not running
β Intelligent Retry Logic
- Automatic process detection with configurable retry attempts
- Handles startup delays gracefully
- Doesn't fail if one process is unavailable
β Visual Feedback
- GUI message boxes for status notifications
- Color-coded console output for clear feedback
- Detailed operation summary with success/failure indicators
β Robust Error Handling
- Specific exception handling for different error scenarios
- Graceful degradation if permissions are restricted
- Comprehensive error logging and reporting
β Administrator Privilege Management
- Automatic elevation to admin rights if needed
- One-click re-execution without manual UAC prompts
- Operating System: Windows 10 or Windows 11
- PowerShell: Version 3.0 or higher (built-in on all supported Windows versions)
- Administrator Privileges: Required (script will auto-elevate)
- Voicemeeter: Installed at default location or custom path configured
- Dependencies: Windows Forms library (included in Windows)
-
Clone or download the repository
git clone https://github.com/yourusername/audio-optimizer.git cd audio-optimizer -
Save the script
- Place
Start-VoicemeeterOptimized.ps1in a convenient location (e.g.,C:\Scripts\)
- Place
-
Enable Execution Policy (if needed)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
-
Save the script to a permanent location:
C:\Scripts\Start-VoicemeeterOptimized.ps1 -
Open Task Scheduler (press
Win + R, typetaskschd.msc) -
Create a new task:
- Name:
Audio Optimizer - Description: Optimize Voicemeeter and Audiodg at startup
- Trigger: At system startup
- Action: Start a program
- Program:
powershell.exe - Arguments:
-NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Start-VoicemeeterOptimized.ps1"
- Program:
- Additional: Check β "Run with highest privileges"
- Name:
-
Save the script to
C:\Scripts\Start-VoicemeeterOptimized.ps1 -
Create a shortcut or batch file in the Startup folder:
- Press
Win + R, typeshell:startup - Create a
.batfile with:@echo off powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Start-VoicemeeterOptimized.ps1"
- Press
Run the script from PowerShell:
.\Start-VoicemeeterOptimized.ps1The script will:
- β Check for administrator privileges (auto-elevate if needed)
- β Search for Audiodg.exe
- β Check if Voicemeeter is running
- β Start Voicemeeter if not found
- β Apply High priority to both processes
- β Pin both to CPU Core 0
- β Display summary of operations
For detailed troubleshooting information:
.\Start-VoicemeeterOptimized.ps1 -VerboseDirect execution without opening PowerShell ISE:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Start-VoicemeeterOptimized.ps1"All settings are centralized in the $Script:Config hashtable at the top of the script. Modify these values to customize behavior:
$Script:Config = @{
AudiodgProcessName = 'audiodg'
VoicemeeterProcessName = 'voicemeeter8x64'
VoicemeeterExecutable = 'C:\Program Files (x86)\VB\Voicemeeter\voicemeeter8x64.exe'
TargetPriority = [System.Diagnostics.ProcessPriorityClass]::High
TargetAffinity = [System.IntPtr]1 # CPU Core 0
MaxRetryAttempts = 3
RetryDelaySeconds = 2
VoicemeeterStartupDelay = 3 # Seconds to wait after starting
}| Parameter | Default | Description |
|---|---|---|
AudiodgProcessName |
'audiodg' |
Windows process name for audio device graph |
VoicemeeterProcessName |
'voicemeeter8x64' |
Voicemeeter process name |
VoicemeeterExecutable |
Default install path | Full path to Voicemeeter executable |
TargetPriority |
High |
Process priority level |
TargetAffinity |
1 (CPU Core 0) |
CPU core to pin processes to |
MaxRetryAttempts |
3 |
Number of process detection retries |
RetryDelaySeconds |
2 |
Delay between retries in seconds |
VoicemeeterStartupDelay |
3 |
Seconds to wait for Voicemeeter initialization |
Custom Voicemeeter Path Example:
VoicemeeterExecutable = 'C:\Custom\Path\voicemeeter8x64.exe'Different CPU Core:
# Pin to CPU Core 1 instead of Core 0
TargetAffinity = [System.IntPtr]2
# Pin to CPU Core 2
TargetAffinity = [System.IntPtr]4
# Pin to CPU Core 3
TargetAffinity = [System.IntPtr]8Audiodg.exe runs as a Protected Process Light on modern Windows versions. This means:
- β You may still optimize it, but changes might be partial
β οΈ Priority changes: May succeedβ οΈ Affinity changes: May be blocked even with administrator privileges- Status: This is normal behavior and not an error
- Ensure Voicemeeter is installed at the default location:
C:\Program Files (x86)\VB\Voicemeeter\ - If installed elsewhere, update the
VoicemeeterExecutableconfiguration - The script will not fail if Voicemeeter is not installed, but won't start it
- This script requires administrator privileges
- It will automatically re-execute with elevated rights
- You may see a UAC prompt on first runβthis is expected and necessary
- Pinning to a single CPU core is intentional for audio consistency
- This reduces context switching and improves real-time performance
- Only recommended for dedicated audio workstations
Problem: cannot be loaded because running scripts is disabled
Solution 1: Change Execution Policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -ForceSolution 2: Bypass for One-Time Run
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Start-VoicemeeterOptimized.ps1"Problem: UAC prompt appears but script doesn't elevate
Solution:
- Open PowerShell as Administrator manually
- Execute the script directly:
& "C:\Scripts\Start-VoicemeeterOptimized.ps1"
Problem: Script says Voicemeeter couldn't be started
Solutions:
- Verify Voicemeeter is installed correctly
- Check the configured path in
$Script:Config - Ensure the executable file exists at the specified location
- Try starting Voicemeeter manually first
Check Installation Path:
Test-Path "C:\Program Files (x86)\VB\Voicemeeter\voicemeeter8x64.exe"Problem: Script reports "audiodg.exe process not found"
This is normal if:
- Audio services are temporarily disabled
- No audio devices are connected
- Windows is still initializing at startup
Solution: Wait a few seconds and run the script again, or increase RetryDelaySeconds in configuration.
Problem: Settings show as failed or partial success
Possible Causes:
- Protected Process Light: Audiodg.exe may block changes
- Insufficient Permissions: Ensure script runs as Administrator
- Process Locked: Application or driver has exclusive access
Workarounds:
- This is often expected behavior for Audiodg.exe
- Try restarting audio services:
Restart-Service -Name audiosrv - Check for audio driver conflicts
- Right-click on desktop β New β Shortcut
- Enter the target:
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\Start-VoicemeeterOptimized.ps1" - Click Advanced and check β Run as administrator
Create separate Task Scheduler tasks with different triggers:
# Trigger 1: At system startup
# Trigger 2: On user logon
# Trigger 3: Every 1 hour (if processes restart)Modify the script to log all operations:
$LogPath = "C:\Logs\Audio-Optimizer-$(Get-Date -Format 'yyyyMMdd').log"
Start-Transcript -Path $LogPath -Append
# ... script execution ...
Stop-TranscriptSource the script functions in another PowerShell script:
. "C:\Scripts\Start-VoicemeeterOptimized.ps1"
# Now you can call individual functions:
Optimize-AudiodgProcess
Start-VoicemeeterApplicationWe welcome contributions! Here's how to help:
-
Report Issues
- Describe the problem clearly
- Include your Windows version
- Provide PowerShell version output:
$PSVersionTable
-
Suggest Improvements
- Feature requests welcome
- Open an issue with detailed description
-
Submit Code
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -am 'Add your feature' - Push to branch:
git push origin feature/your-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Β© 2025 Meyer Media
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limited the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- Issues: Open an issue on GitHub
Version: 2.0
Last Updated: November 26, 2025
Maintainer: @mleem97