WebCord icon indicating copy to clipboard operation
WebCord copied to clipboard

Stereo mic support

Open IDeathByte opened this issue 2 years ago • 1 comments

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 avatar Oct 01 '23 10:10 IDeathByte

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.

SpacingBat3 avatar Oct 08 '23 18:10 SpacingBat3