Repository navigation
Conversation
A mute, or a deafen, pauses speaking detection, and nothing ended that pause when the push-to-talk key was pressed with the mute still on. The key opens the microphone whatever the mute flag says, so: - In a voice channel the gate, closed by the pause, stayed closed: silence was sent while the button showed an open microphone and the others saw the mute lifted. - In a direct call the voice was sent, and neither side saw the ring. A stop resets the pause, so after a rebuild of the pipeline, or in a call joined with the mute already on, the key did work: what it did depended on whether the mute had been clicked since the pipeline was built. The key press now ends the pause. The release is unchanged: the raw track is disabled, the detector hears silence and says "not speaking" by itself, and a voice channel's producer is paused as after any release. With detection running under the flag, two places that left the microphone open under it now close it: - A deafen switched on while the key holds the microphone open under the mute flag closes the track, pauses the producer and pauses detection, as a deafen with no mute flag does. Left open, a direct call went on sending the voice, and a voice channel showed a ring for a voice the server no longer forwarded. - A voice channel's connection restart under the mute flag closes the raw track, as a socket reconnect does: the new producer starts paused under the flag, here and on the server, so a ring would show for a voice nobody hears. The key pressed again opens it. (A secure channel's restart is a new join, which already closed it.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
In push-to-talk mode the key opens the microphone whatever the mute flag says. A mute, or a deafen, also pauses speaking detection, and nothing ended that pause when the key was pressed with the mute still on:
A stop resets the pause, so after a rebuild of the audio pipeline, or in a call joined with the mute already on, the key did work: what it did depended on whether the mute had been clicked since the pipeline was built.
What the code does now
usePushToTalk), after it has enabled the microphone track. In a voice channel the gate opens for the voice again; in both kinds of call "speaking" is announced and the ring shows, on the person's own avatar in a direct call too.This changes one sentence of #380: the ring on one's own avatar in a direct call no longer stays off while muted with the key held. It lights there, as it now does for the other person.
Key files
apps/desktop/src/hooks/usePushToTalk.tsapps/desktop/src/stores/voiceStore.ts(toggleDeaf, and the plaintext branch of a connection restart)apps/desktop/src/__tests__/stores/voicePushToTalkRelease.test.tsx(the second block)Migrations
None. The server is unchanged.
Tests
voicePushToTalkRelease.test.tsx, through the real hook and the real store: the key under the mute flag in a voice channel and in a direct call, the release, a mute and a deafen switched on while the key is held (with and without the flag, the deafen in both kinds of call), a key press with no flag, with no call, and a call that ends with the key held.voiceMicTrackLife.test.ts: a connection restart with the key held, under the mute flag (the raw track closes) and without it (it stays open), and under a moderator's mute (it closes with the flag).audioAnalyser.test.ts: while the page timer decides, the end of a pause lets the next tick open the gain and announce "speaking" again, in a voice channel and in a direct call.DMVoicePanelRenders.test.tsx: the mute flag does not hide the ring while the key is held; a detector still paused shows none.pnpm typecheck,pnpm lintand the desktop unit suite pass on the branch.To check by hand
In push-to-talk mode, with a second person in the call: