This program implements "push-to-talk" functionality for programs that access your microphone using PulseAudio. It was created because Zoom's Linux client does not support push-to-talk. (The Windows and macOS clients do support push-to-talk.)
Once your program of interest has started getting audio from your microphone, launch ptt_pa. A black window will appear, and the program will stop receiving microphone input. When the space key is held, the window will turn white and the program will receive microphone input again.
- Xlib, and development headers if building from source. On Ubuntu the library is provided by the package libx11-6 and the headers are provided by the package libx11-dev.
- pacmd. On Ubuntu this program is provided by the package pulseaudio-utils.
Run Make in the root directory of this repository. This will produce an executable ptt_pa in that same directory.
- Start your program of interest, and start recording audio. (It's not enough to just start the program. For Zoom, this means that you should join a meeting before proceeding.)
- Run
pacmd list-source-outputs
. Make note of the index of the output associated with the program you're interested in. - Run
./ptt_pa [THAT INDEX]
. - Press and hold the space key whenever you wish to unmute yourself.
- Closing the program while muted will leave the output muted.
- Workaround: hold space to stay unmuted while closing the program.
- User is unmuted when program is first started even though they should be muted.
- Workaround: mute and unmute every time you start the program to ensure that you're in the correct state.
- Using system commands is pretty gross. I'd like to switch to PulseAudio's C library at some point.