UNPKG

@fishjam-cloud/react-client

Version:
20 lines 989 B
import type { PeerId } from "../types/public"; /** * Client-side voice activity detection for the local peer. * * Polls the local microphone's audio level every 100ms and derives a speech/silence * state from it. A level above ~0.025 (approximately −32 dBov, scaled to [0, 1]) * is treated as speech. Silence is debounced over 2 consecutive ticks (~200ms) * to prevent rapid flapping. * * This is purely client-side — it does not signal other peers. Remote participants * receive the local peer's VAD status via backend `vadNotification` messages. * * @internal Used by `useVAD` when the local peer's id is included in `peerIds`. * @returns A record mapping the local peer's id to its current speaking state, * or an empty object if `options.disabled` is true, the local peer is not available, or no microphone track is found. */ export declare const useLocalVAD: (options: { disabled: boolean; }) => Record<PeerId, boolean>; //# sourceMappingURL=useLocalVAD.d.ts.map