Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discord audio volume balancing #10

Open
Stieneee opened this issue Feb 3, 2021 · 4 comments
Open

Discord audio volume balancing #10

Stieneee opened this issue Feb 3, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Stieneee
Copy link
Owner

Stieneee commented Feb 3, 2021

No description provided.

@Stieneee Stieneee added the enhancement New feature or request label Feb 3, 2021
@Stieneee Stieneee added the help wanted Extra attention is needed label Apr 24, 2021
@OpaqueReptile
Copy link

Do you have any ideas how this could be implemented? This is a feature I'd very much be interested in, but I'm not sure how it could be implemented... Would it be possible to have the mumble side create a puppet user for each discord user?

@Stieneee
Copy link
Owner Author

Yes, multiple mumble connections would be possible.

I have been considering a solution in which we simply apply a gain to PCM audio data after the bridges decode the opus data before mixing. (Have a look at this diagram if you need additional context. https://github.com/Stieneee/mumble-discord-bridge/blob/main/docs/audio-flow.drawio.png) I did try applying a simple gain in the early days but it never seemed quite right. Ultimately I found that asking people to adjust their mic sensitivity in discord was a low-tech way of solving the problem.

I think both options have their pros and cons. The gain option is simpler but we would have to figure out an interface to adjust the volume per stream. (Maybe just a command interface through the chat).

The multiple mumble options would be interesting as you could then use mumbles local audio adjustment interface to control the volume. The trade-off with these options would be that you now have more stateful connections and buffer streams to manage.

If you want to take a stab at implementing either option I would be happy to provide feedback as you progress. Either option will certainly be a welcomed improvement.

@OpaqueReptile
Copy link

OpaqueReptile commented Aug 31, 2021

I think I'd prefer the multiple mumble connection/puppet user approach. It's more elegant from a UX standpoint and reduces likelihood of weird gain issues like you mentioned.

I've been trying to wrap my head around how the bridge is moving audio around and learning how the heck opus works. Your diagram was very helpful - I've recreated it with some modifications for how I think the bridge would work going with the multi-user option (additions in green):

mumble-discord-bridge_multiple_puppets

Will definitely take a stab at implementing this sometime soon.

@Stieneee
Copy link
Owner Author

Stieneee commented Sep 3, 2021

Ya, I think it is totally worth a shot. It will be really awesome to see who is connected to discord by looking at the mumble list.

I would definitely like to look into stereo audio at some point.

Learn about opus while working on this was certainly interesting. For this project, however, once you understand to decode and decode it additional knowledge is not really needed. If we are passing the opus data straight through we might be able to skip the opus decode/encode for audio flowing discord to mumble as the primary reason we needed to decode it was to mix the audio in PCM format.

As I think about the possible implementation some questions come up.

  • Currently, the user can specify a client cert for mumble authentication. I wonder if we can use the same cert for each puppet? What happens if the discord listener user or a puppet user is registered?
  • How far should we take the UI integration what happened if a mumble admin kicks or bans a puppet user?
  • The state logic around the listener and puppet connections.
  • If we can flow through. Do we still need the buffers are can we just forward on receive?

If you have any questions I will try to respond within 24 hours. Unfortunately, I am moving in a couple of weeks and backlogged with other work so I don't have a ton of time to work on improvements.

Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants