Discord screen share with audio on Linux!

dreamingcodes

Lorenzo Rizzotti

Posted on September 8, 2022

Discord screen share with audio on Linux!

Unfortunately, if you're using Discord on a Linux-based operating system, you know that Discord screen sharing doesn't include audio from your apps like how Windows and macOS does.
I searched for a way to get audio working for Discord screen share on Linux; I found another guy with the same frusration, so I decided to work with him to create Tuxphones, a program made of two components: a daemon and a BetterDiscord plugin.
The daemon creates a virtual PulseAudio sink, and the BetterDiscord plugin sends discord stream information to the daemon and blocks the default Discord stream.

After the information is sent over, the daemon takes over and creates a WebSocket connection with Discord's gateway then connects to Discord’s RTC servers.

After a lot of trial and error, we managed to get a video stream to the discord server with our external using H264 but we still haven't managed to make discord's webrtc backend read our Opus audio stream.
We don't know what the error is and we are trying to investiage it, but neither of us know that much about WebRTC.

If anyone wants Discord screenshare with audio on Linux as bad as we do and knows WebRTC, please help us out.

You can find our code on Github:
Tuxphones: https://github.com/ImTheSquid/Tuxphones
gst-webrtcredux (the plugin that we developed to use webrtc-rs with gstreamer): https://github.com/ImTheSquid/gst-webrtcredux

💖 💪 🙅 🚩
dreamingcodes
Lorenzo Rizzotti

Posted on September 8, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related