@mosadd/voice-truthgate
v0.1.0-alpha.2
Published
Voice Truthgate by mosADD — open-core voice-deepfake detection SDK. On-device heuristic triage + a pluggable server confirmation detector, fused into an honest confidence BAND (never a bare verdict). Publishes to npm as @mosadd/voice-truthgate.
Readme
@mosadd/voice-truthgate
Voice Truthgate by mosADD — an open-core (MIT) SDK for voice-deepfake / synthetic-speech detection.
Publishes to npm as
@mosadd/voice-truthgate(internal workspace name:@m0ssad/voice-truthgate-sdk).📖 New here / not an engineer? Read
docs/VOICECHECK.md— a plain-language walkthrough of how the whole thing is built (also live at/voice-truthgate/how-it-works).
It gives you a two-stage, honest signal:
- On-device heuristic triage — instant, private, no model download. A pure-DSP scorer (spectral tilt, ZCR jitter, prosody flatness, breath pauses, F0 variance). Cheap floor, weak on modern TTS — a triage, not a verdict.
- Server confirmation (optional, you inject it) — a trained anti-spoof model (VoiceGuard, XLS-R+AASIST) run server-side. Authoritative when reachable; fail-open if not.
Results are a confidence band (likely-authentic / uncertain / likely-synthetic) with a mandatory "signal, not a verdict" disclaimer — never a bare true/false. See MODEL_CARD.md.
Why band-first / signal-not-verdict?
No detector reliably beats ~85% on unseen modern TTS, and codec compression (Opus/MP3/telephony) degrades accuracy 10–40%. A public tool that confidently says "FAKE" and is wrong harms real people. This SDK is built so you cannot accidentally surface a bare verdict.
Usage
import { analyzeVoiceTruthgate, createHeuristicDetector, createServerDetector } from "@mosadd/voice-truthgate";
// decode your audio to mono PCM first (Float32Array) — see the hosted app's decodeToPcm.
const payload = { samples, sampleRate: 16000 };
// On-device only (instant, private):
const quick = await analyzeVoiceTruthgate(payload);
console.log(quick.band.label, quick.confidence, quick.disclaimer);
// Hybrid (triage + server confirmation). You provide how the server is reached
// (the SDK never hard-codes an endpoint/keys):
const server = createServerDetector({
analyze: async (p) => callYourProxy(p), // → { confidence, modelVersion, reasons? }
version: "voiceguard-v9c",
});
const full = await analyzeVoiceTruthgate(payload, { detectors: [createHeuristicDetector(), server] });
// server verdict wins when it answers; falls back to on-device if it fails.analyzeVoiceTruthgate always returns { available, confidence, band, reasons, detectorId, modelVersion, disclaimer, isSignalNotVerdict, verdicts }. When nothing usable answers, available is false and the band is uncertain — never likely-authentic.
Building on the pluggable core
This SDK is built on @mosadd/detection-sdk (Detector / Verdict / runDetectors, fail-open) and @mosadd/voice-analyzer-core (the pure-TS heuristic). Add your own detectors (edge ONNX, watermark check, etc.) and pass them to analyzeVoiceTruthgate.
License
MIT © mosADD. Use freely, including commercially. Attribution appreciated. The server model (VoiceGuard) is Apache-2.0 — keep its attribution when you deploy it.
