#this is the current code meant to enable
1 messages ยท Page 1 of 1 (latest)
I've created a plugin for it https://github.com/Vendicated/Vencord/pull/3909
This plugin enables stereo audio when watching streams
no not like that
have a look at the link I sent
it patches Discord's code with regex
have a look at the code and you want to use regex to add the options
Yeah, I'll have to debug that to see why it's not working. I'm adding the same params and also only for opus. But mine works, this doesn't
But for now I gotta sleep. Thanks for pointing me in the right direction though!
codec === Codecs.OPUS && media.fmtp.push({
config: "minptime=10;useinbandfec=1;usedtx=".concat(sendingVideo ? "0" : "1").concat(sendingVideo ? ";stereo=1;sprop-stereo=1" : ""),
payload: payload
}),
this is what vencord does
Yeah, and my current implementation modifies the RTCPeerConnection prototype to add exactly stereo=1;sprop-stereo=1 to the oups line(s) in the SDP. I haven't yet fully understood what the effective difference is, so I'll use the prototype overwrite tomorrow to check what the actual differences in the description sent is. Then I should be able to pin down what exactly is going wrong with the current vencord fix.
Quick check shows that the vencord solution does nothing
When connecting to a voice chat.
Might when streaming
well it does check sendingVideo so might be that
idk if that only applies to your streams or all streams
the reason for that boolean is that we don't want it to patch your microphone audio
try removing the boolean check and just always adding it and see if that fixes it
Removing the boolean check does result in the same output as my plugin character for character
Don't havet he chance right now to test it with a stream
This will probably cause a regression in some other ways though. I do remember reading about people having the issue that their microphone turned one-sided for everyone else when they started streaming
This might trigger that again
yesss this is exactly why we dont want to affect the microphone
but maybe there's a better way to detect that
It's so weird. I did the change, the SDP is the same with/without my plugin fix (so not the patch, but the one I pushed last night originally).
But only the plugin fix seems to actually work
I found the issue. The current fix only affects answers, not offers.
From what I've found, some offers don't include the usedtx= at all.
The SDL there contains
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
Even with the video flag removed from the patch.
My plugin solution results in the following
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1
The latter results in a stereo stream
Searching through the discord client code, I can't find any spot other than the one that's already patched where this is set.
No smart answer from me yet, but the patched code does not get called when creating an offer
Only for the answer
Yup. I've added a comment in the PR. I am not familiar enough and am getting a litte sick of stepping in/through functions for now. Evidence shows that the patch doesn't apply to offer SDPs, only to answers
From what I've seen the WebRRCPeerConnection.createOffer function is native code - that's where the sdp comes from for offers