Last active
September 15, 2025 14:07
-
-
Save furious/76f12c2758f7b23c1fac590e669b69fc to your computer and use it in GitHub Desktop.
Powershell/Nodejs script to mirror the current Elgato Wave jack output volume to the monitor mix device volume (if you're using nothing connected the the jack output).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const socket = new WebSocket('ws://localhost:1824'); | |
| socket.addEventListener('open', () => { | |
| console.log('Connected to WebSocket server.'); | |
| }); | |
| socket.addEventListener('message', (event) => { | |
| try { | |
| const message = JSON.parse(event.data); | |
| if (message.method === 'microphoneConfigChanged') { | |
| const value = Math.round(message.params.value * 100); | |
| const response = { | |
| jsonrpc: '2.0', | |
| id: Math.floor(Math.random() * 1000000), | |
| method: 'setOutputConfig', | |
| params: { | |
| mixerID: 'com.elgato.mix.local', | |
| property: 'Output Level', | |
| value: value | |
| } | |
| }; | |
| socket.send(JSON.stringify(response)); | |
| } | |
| } catch (err) { | |
| console.error('Error parsing message:', err); | |
| } | |
| }); | |
| socket.addEventListener('close', () => { | |
| console.log('WebSocket connection closed.'); | |
| }); | |
| socket.addEventListener('error', (err) => { | |
| console.error('WebSocket error:', err); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install-Module -Name WebSocket -Scope AllUsers | |
| $socket = Get-WebSocket ws://localhost:1824 | |
| $socket | Receive-Job -Wait | Where-Object { $_.method -eq 'microphoneConfigChanged' } | forEach-Object { | |
| $socket.Send(@{ | |
| jsonrpc = '2.0'; | |
| id = (Get-Random); | |
| method = 'setOutputConfig'; | |
| params = @{ | |
| mixerID = 'com.elgato.mix.local'; | |
| property = 'Output Level'; | |
| value = ([int][Math]::Round($_.params.value * 100)) | |
| } | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment