An automated AI pipeline for speech-based lie / scam risk analysis, combining Audio preprocessing → Speech-to-text (Whisper) → LLM reasoning → Alerts.
This project is designed for hands-free background monitoring (e.g. mobile call recordings) and supports automatic Gmail / Discord notifications when high-risk speech patterns are detected.
- 🎧 Audio & video input support (
.wav,.mp3,.m4a,.mp4, etc.) - 🧠 AI-based lie / scam risk analysis via LLM
- 📊 Risk scoring with configurable threshold
- 📬 Automatic Gmail alert
- 💬 Discord webhook notification
- 🔁 Folder monitoring (polling-based, stable & mobile-friendly)
- 🛡 Guardrails to avoid false alerts on very short / insufficient audio
- 📱 Designed to run persistently on Termux (Android) or Linux
gpt_lie_analysis/
├── src/gpt_lie_analysis/
│ ├── core.py # Main pipeline logic
│ ├── whisper_transcribe_api.py
│ ├── gpt_lie_analysis_requests.py
│ ├── audio_loader.py
│ ├── segment_and_analyze.py
│ ├── gmail_notify.py
│ └── cli/
│ └── app.py # CLI entrypoint
├── scripts/ # Helper scripts (optional)
├── tests/
├── pyproject.toml
├── requirements.txt
└── README.md
- Python ≥ 3.10
ffmpeg- OpenAI API Key
sudo apt install -y ffmpegCreate a .env file in project root:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxLoad it into current shell (important for Termux / nohup):
set -a
source .env
set +apython -m venv .venv
source .venv/bin/activate
pip install -e .Verify:
lie-analyzer --helplie-analyzer one ./test.wav --threshold 7Used mainly for:
- Debugging
- Demo recordings
- Development testing
lie-analyzer scan \
--interval 3 \
--call-rec "/sdcard/MIUI/sound_recorder/call_rec" \
--recordings "/sdcard/Recordings" \
--meta-ai "/sdcard/Download/Meta AI" \
--threshold 7This mode:
- Continuously monitors predefined folders
- Automatically detects new recordings
- Waits for file write completion (prevents half-written files)
- Triggers analysis + alerts when needed
Recommended for mobile usage.
nohup lie-analyzer scan \
--interval 3 \
--call-rec "/sdcard/MIUI/sound_recorder/call_rec" \
--recordings "/sdcard/Recordings" \
--meta-ai "/sdcard/Download/Meta AI" \
--threshold 7 \
> lie_analyzer.log 2>&1 &
echo "PID=$!"tail -f lie_analyzer.logpkill -f "lie-analyzer scan"- If your audio is too short, the LLM may refuse to give a score. Provide longer speech.
- For
.mp4videos, the pipeline will extract audio first (ffmpeg required).
MIT (or your preferred license)