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

Stereo mic support #471

Open
IDeathByte opened this issue Oct 1, 2023 · 1 comment
Open

Stereo mic support #471

IDeathByte opened this issue Oct 1, 2023 · 1 comment
Assignees
Labels
type:feat New feature or request

Comments

@IDeathByte
Copy link

IDeathByte commented Oct 1, 2023

Description

It possible to add some injection code or change connection settings for support stereo input devices?
In native client we can do one workaround step for enable support
https://support.discord.com/hc/en-us/community/posts/360050373871/comments/17341738272791

Edit ~/.config/discord/0.0.*/modules/discord_voice/index.js and find setTransportOptions in the bindConnectionInstance function. Replace the entire line with this:

setTransportOptions: (options) => {
      if(options.audioEncoder)
      {
        options.audioEncoder.params = { channels: 2, };
        options.audioEncoder.channels = 2;
        options.audioEncoder.freq = 48000;
        options.audioEncoder.rate = 384000;
        options.audioEncoder.pacsize = 20;
      }
      if(options.encodingVoiceBitRate) options.encodingVoiceBitRate = 256000;
      return instance.setTransportOptions(options);
    },

@IDeathByte IDeathByte added the type:feat New feature or request label Oct 1, 2023
@SpacingBat3
Copy link
Owner

WebCord works more closely to browsers in terms of audio or screen sharing than to actual Discord client – so tricks that work on Discord internal modules won't work on WebCord.
Also, technically is is possible to use screen share audio for stereo mic right now, but I highly doubt that's desired to happen.
It might also not be possible to implement the stereo microphone at all if Discord is processing the audio differently for browser clients or due to WebRTC implementation between browsers and Discord, although I haven't took any look if it isn't actually possible to tweak Discord's microphone input via getUserMedia to use stereo input as I suppose they might be using this API for audio input. But I haven't took any deep look into Discord internals, at least for a while, so I dunno much about the actual implementation yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feat New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants