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
Top comments (4)
It works like a charm, thank you for it!
If anyone needs a little help in how it works, let me share my experience
.deb
package)BetterDiscord
if you haven't already (in my case I downloaded the.AppImage
, gave execution permissions to the file doingchmod +x <better_discord_file.AppImage>
and execute it./<better_discord_file.AppImage>
)Tuxphones
(in my case I'm usingasdf
to get the packages needed for it, likerust
, but you can install it from the Rust webpage itself)Hi, I'm glad you tried Tuxphones!
Was the stream for viewers visible right away? Also can you confirm that the audio is not working for you too?
The stream was working just fine, it was weird when I've wanted to show a game because there was a glich for a second on the audio, but that's about it
Maybe tomorrow I will have problems or not, I'll let you know in Github!
This is really weird. As you can read from the post we are trying to understand why dicord does not read our audio stream but now you tell us that everything works