Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

System-wide Push to Talk #22

Open
TheArmKing opened this issue Nov 7, 2021 · 3 comments
Open

System-wide Push to Talk #22

TheArmKing opened this issue Nov 7, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@TheArmKing
Copy link

Would adding support for system-wide Push to Talk be possible? Currently, it will only work if the window has focus (as stated by Discord on the browser version itself), but is there any workaround?

@yannhodiesne yannhodiesne added enhancement New feature or request help wanted Extra attention is needed labels Nov 7, 2021
@yannhodiesne
Copy link
Owner

I don't know if it is possible, but it's worth a try

@BE-CH
Copy link

BE-CH commented Nov 9, 2021

This should be possible. You can use Electron GlobalShortcut https://www.electronjs.org/docs/latest/api/global-shortcut for a system-wide keyboard shortcut.

The only concern is finding and running the Discord javascript that enables the microphone and transmits the audio.

@yannhodiesne
Copy link
Owner

The only concern is finding and running the Discord javascript that enables the microphone and transmits the audio.

I've got two ideas in mind:

  • Abusing the mic off button of the Discord client, not clean at all but will work fine
  • Using a preload script to wrap a custom function around the browser's sound API, to have control over the stream requested by Discord and mute it whenever the globalShortcut is not pressed

My only concern about the second one is the CPU usage, we will need to keep an eye on the activity monitor while testing it

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

No branches or pull requests

3 participants