Professor-Melvin / ElgatoWaveLinkSDK

SDK For Elgato Wave Link Software
GNU General Public License v3.0
9 stars 1 forks source link

Can't change output mixer volume #1

Closed MrToWy closed 2 years ago

MrToWy commented 2 years ago

When calling this: var newSetting = await client.SetOutputMixer(1, false, 1, true);

The response is:

{
    "id": 10,
    "jsonrpc": "2.0",
    "result": {
        "isLocalOutMuted": false,
        "isStreamOutMuted": false,
        "localVolumeOut": 0,
        "streamVolumeOut": 0
    }
}

Expected response:

{
    "id": 10,
    "jsonrpc": "2.0",
    "result": {
        "isLocalOutMuted": false,
        "isStreamOutMuted": true,
        "localVolumeOut": 1,
        "streamVolumeOut": 1
    }
}
Professor-Melvin commented 2 years ago

Hey,

Yeah, one of the reasons I stated the commands aren't working is because I couldn't get the wave link software to reply correctly. I ended up pausing the project I made this library for so I never got the time to properly troubleshoot it

I'll try have another look this week though, But in the mean time, have a look at the stream deck plugin for the wave link. I based this library on the JavaScript library they're using there, you might be able to figure it out before I do

MrToWy commented 2 years ago

I think that it might be something related to StreamJsonRpc.
Used your code without the StreamJsonRpc and it works perfectly:

using (var ws = new WebSocket($"ws://{"localhost"}:{1824}/"))
            {
                ws.OnMessage += (sender, e) =>
                    Console.WriteLine(e.Data);

                ws.Connect();

                ws.Send("{    \"id\": 3,    \"jsonrpc\": \"2.0\",    \"method\": \"setOutputMixer\",    \"params\": {                    \"isLocalOutMuted\": true, \"isStreamOutMuted\": true, \"localVolumeOut\": 33, \"streamVolumeOut\": 44    }            }            ");
                Console.ReadKey(true);
            }

Same goes for SetMonitorMixOutput: ws.Send("{ \"id\": 3, \"jsonrpc\": \"2.0\", \"method\": \"setMonitorMixOutput\", \"params\": { \"monitorMix\": \"" + (_useSpeaker ? speaker : headphones) + "\" } } ");

Professor-Melvin commented 2 years ago

Oh cool! I'll take a look at this tonight! Thanks for testing this out

oddbear commented 2 years ago

Awesome, and great work. Hope you figure it out. I started on something similar, but did not have the time for it. So it was really nice to find this repo.

Professor-Melvin commented 2 years ago

So I dropped the use of StreamJsonRpc, couldn't figure out what it was doing wrong that set commands werent working

Latest push isn't complete everything except the switchMonitoring and setInputMixer commands work.

I'm in the middle of moving so I didn't have a lot of time to look through the stream deck plugin to see how they're expecting the setInputMixer command to work. And for what ever reason I can use the switchMonitoring comamnd to go to stream mix but not monitor mix, a bit odd but I'm assuming it's something small I just can't see right now

I'll try have another sit down during the week to see what is different about those two commands

Professor-Melvin commented 2 years ago

Closing this as it was the rpc library blocking the use of SetOutputMixer