Files
cinny/src/app/hooks/useCallDenoise.ts
T
Lotus CIandClaude Opus 5.5 504899aa14
CI / Build & Quality Checks (push) Skipped
CI / Secret scan (gitleaks) (push) Skipped
CI / Playwright smoke (e2e) (push) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 2m5s
CI / Build & Quality Checks (pull_request) Successful in 3m1s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Playwright smoke (e2e) (pull_request) Successful in 17m2s
feat(calls): change noise suppression mid-call without rejoining
Changing Noise suppression (off / browser-native / ML), the ML model, the
gate or "stack browser NS" in Settings now applies to the call you're in.
useCallDenoise sends the fork's io.lotus.set_denoise whenever those
settings change; CallControl join-gates it like set_quality and re-sends
it after an EC reconnect (the remounted fork handler starts again from
the join URL). The "requires rejoining the call" note is replaced.

Bumps Element Call to 0.28.0-lotus.4, which adds io.lotus.set_denoise and
fixes mic re-captures silently keeping the old noiseSuppression (the mic
level meter's clone held the old track open), the meter following the
old device after a mic switch, and voiceIsolation staying on in off/ML
modes (element-call#66).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
2026-10-30 21:19:56 -04:00

42 lines
1.2 KiB
TypeScript

import { useEffect } from 'react';
import { useAtomValue } from 'jotai';
import { CallEmbed } from '../plugins/call';
import { settingsAtom } from '../state/settings';
import { buildDenoisePayload } from '../utils/callDenoise';
/**
* Apply noise-suppression setting changes to a call that's already running
* (the fork's `io.lotus.set_denoise`): switching between off, browser-native
* and an ML model, or between models, takes effect without rejoining. The join
* itself still carries the settings in the call URL, so the first send is a
* no-op fork-side.
*/
export function useCallDenoise(embed: CallEmbed): void {
const {
callNoiseSuppression,
callDenoiseModel,
callDenoiseNativeNS,
callDenoiseGate,
callDenoiseGateThreshold,
} = useAtomValue(settingsAtom);
useEffect(() => {
embed.control.setDenoise(
buildDenoisePayload({
callNoiseSuppression,
callDenoiseModel,
callDenoiseNativeNS,
callDenoiseGate,
callDenoiseGateThreshold,
}),
);
}, [
embed,
callNoiseSuppression,
callDenoiseModel,
callDenoiseNativeNS,
callDenoiseGate,
callDenoiseGateThreshold,
]);
}