VoiceShield is an advanced real-time voice verification and deepfake detection system. It seamlessly integrates a robust Node.js media gateway, a high-performance FastAPI ML inference backend, and a modern Next.js frontend to monitor live telephony calls. By intercepting live calls and streaming audio chunks asynchronously, VoiceShield detects synthetic voices and spoofing attempts without interrupting the user.
- Real-Time Chunking: The media gateway intercepts raw PCM telephony streams from an Android device (via CallVault daemon) and forwards audio chunks (3 seconds) asynchronously to the ML pipeline.
- Audio Evidence Models: Indic RawNet2, Dhwani ONNX and custom WavLM analyze synthetic-speech evidence; ECAPA compares speaker embeddings. ECAPA is not a deepfake detector.
- Live Dashboard: Watch chunk processing, VAD, RMS Energy Waveforms, and Spectrograms in real-time on the Next.js/React frontend via WebSocket/SSE integration.
- PostgreSQL Persistence: Comprehensive call records, raw chunks, and ML scores are securely saved for analysis.
- Blockchain Evidence Integrity: Final WAV evidence stays playable off-chain while its SHA-256 fingerprint and canonical AI-result commitment are anchored to an append-only EVM contract. See Blockchain Audit Trail for local setup, verification, threat model, and SIH tampering demo.
- Android Integration: Native integration with CallVault (privileged daemon on Android) to intercept audio streams directly at the OS level.
- FreeSWITCH Integration**: Handles SIP signaling and streams raw PCM audio into the ML backend.
You can download the latest debug build of the VoiceShield CallVault daemon for Android devices here: Download VoiceShield-CallVault-Debug.apk (v1.0.0)
Before starting, make sure you have:
- Node.js (v18+)
- Python (3.10+)
- PostgreSQL Database
- Git LFS (Large File Storage) for downloading model weights
- Docker & Docker Compose (for Media Gateway testing with FreeSWITCH)
The system consists of three main components: Database & Media Gateway, ML Service, and the Frontend Dashboard. Follow these steps in order.
The Media Gateway (port 8010) receives WebSocket audio streams, chunks them, and manages session state.
cd media-gateway
# Set up Prisma ORM
npx prisma db push
npx prisma generate
# Install dependencies
npm install
# Start the Gateway in development mode
npm run devThe ML service (port 8000 / 8011) processes audio chunks and runs deepfake inference using PyTorch.
# From the VoiceShield-AI root directory
# Ensure Git LFS is installed and pull the large model weights
git lfs install
git lfs pull
python3 -m venv .venv
source .venv/bin/activate
# Install requirements with CUDA 12.6 support (if using GPU)
pip install --extra-index-url https://download.pytorch.org/whl/cu126 -r ml/requirements-torch.txt
# Start the Real-Time ML Engine (Runs on port 8011)
# IMPORTANT: You MUST run this from the root VoiceShield-AI directory!
# Install service and analysis dependencies, then start the gateway-compatible ML service
pip install -r ml/requirements.txt -r backend/requirements.txt python-dotenv
python -m ml.server.mainThe active ML service is on port 8011.
backend/appis an older API with separate scoring and demo placeholders; it is not the validated gateway path.
Read the model audit for measured capabilities, weaknesses, model comparisons and sources, and the demo runbook for setup and validation commands. The current result is a 0–100 synthetic-audio evidence index, not a calibrated probability of fraud. Missing evidence yields an unknown result. Public deployment is not validated.
The interactive dashboard (port 3000 or 8085 depending on config) displays real-time results, visualizations, and session logs.
# From the VoiceShield-AI root directory
cd frontend
# Install dependencies
npm install
# Start the development server
npm run devCallVault does not require Shizuku or a PC to intercept telephony audio. It establishes a local persistent privileged daemon entirely on-device by talking directly to your phone's internal Wireless Debugging port.
- Enable Developer Options, then Wireless Debugging, on your Android device.
- Install and open the CallVault app (see the Download section above).
- Follow the onboarding wizard:
- Grant notifications (required to see the pairing prompt).
- Complete the one-time Wireless Debugging pairing by entering the pairing code and port shown in your Android settings.
- Grant the remaining permissions (phone state, call log, contacts, battery exemption).
- Accept the USB debugging prompt when onboarding offers it. CallVault will then automatically handle keeping the necessary services alive without requiring a cable.
The Media Gateway includes an extensive test suite (50+ passing tests covering chunking, protocol validation, and session management).
cd media-gateway
npm run testIf you don't have a physical Android device running CallVault, you can use the built-in Android Simulator to test the complete pipeline (Android -> Gateway -> ML Server -> Database -> Frontend).
The simulator streams audio over WebSockets precisely like the real Android daemon.
# From the VoiceShield-AI root directory
source .venv/bin/activate
# Stream a single specific audio file
python tests/integration/test_android_simulator.py /path/to/audio/file.wav
# Stream all files in a directory sequentially
python tests/integration/test_android_simulator.py /path/to/audio/directory/
# Run with a built-in default sample (librosa trumpet)
python tests/integration/test_android_simulator.pyNote: Make sure your Media Gateway is running on port 8010 before executing the simulator.
You can also test the media gateway and DSP visualizations using SIP.
- Ensure the Docker containers are running (
docker-compose -f docker-compose.yml up -d). - Open a SIP Client (like Linphone) on the same Wi-Fi network.
- Dial
sip:test_call@<YOUR_LAPTOP_IP>:5060. - Speak into your microphone and view live RMS/Spectrogram graphs on the dashboard.
- Android Phone / CallVault captures live 48kHz mono PCM16 audio.
- WebSocket (ws://:8010) streams audio to the Media Gateway.
- Media Gateway buffers and slices audio into precise 3-second chunks (288,000 bytes).
- ML Service (ws://localhost:8011) receives the chunks and executes PyTorch inference.
- Dashboard listens via WebSockets/SSE to visualize results and flag potential fraud instantly.
For a deep dive into the architecture and dynamic SIP Trunk routing, refer to Media Gateway Documentation and STATUS.md.