🎙️ Detects whether a voice recording is AI-generated or Human across 5 Indian languages.
| Model | Purpose | Accuracy |
|---|---|---|
MelodyMachine/Deepfake-audio-detection-V2 | AI/Human Detection | 99.73% |
speechbrain/lang-id-voxlingua107-ecapa | Language Detection | 93.3% |
pip install -r requirements.txt
The models are not included in the repo due to size. Download them first:
# Create models directory
mkdir -p models/deepfake_detector
# Download deepfake detection model from HuggingFace
python -c "
from transformers import Wav2Vec2ForSequenceClassification, Wav2Vec2FeatureExtractor
model_name = 'MelodyMachine/Deepfake-audio-detection-V2'
save_path = './models/deepfake_detector'
print('Downloading model...')
model = Wav2Vec2ForSequenceClassification.from_pretrained(model_name)
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(model_name)
model.save_pretrained(save_path)
feature_extractor.save_pretrained(save_path)
print(f'Model saved to {save_path}')
"
# Using uvicorn directly
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Or using the run script
chmod +x run.sh
./run.sh
curl -X POST https://your-domain.com/api/voice-detection \
-H "Content-Type: application/json" \
-H "x-api-key: sk_test_123456789" \
-d '{
"language": "Tamil",
"audioFormat": "mp3",
"audioBase64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjM2LjEwMAAAAAAA..."
}'
{
"status": "success",
"language": "Tamil",
"classification": "AI_GENERATED",
"confidenceScore": 0.91,
"explanation": "Strong synthetic speech indicators detected: unnatural pitch consistency, flat energy profile. Voice clearly exhibits AI-generated characteristics."
}
{
"status": "error",
"message": "Invalid API key or malformed request"
}
All requests require an API key via the x-api-key header.
Default API Key (for testing): sk_test_123456789
aivoice_detection/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI entry point
│ ├── config.py # Configuration settings
│ ├── routes/
│ │ └── voice_detection.py
│ ├── services/
│ │ ├── audio_processor.py
│ │ ├── language_detector.py
│ │ ├── deepfake_detector.py
│ │ └── explanation_generator.py
│ ├── models/
│ │ └── schemas.py
│ └── middleware/
│ └── auth.py
├── tests/
│ └── test_api.py
├── requirements.txt
├── .env
└── README.md
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ -v --cov=app
# Build image
docker build -t ai-voice-detection .
# Run container
docker run -p 8000:8000 ai-voice-detection
The API provides detailed explanations based on audio analysis:
MIT License
1 commits
Python
69.8%
HTML
27.6%
Shell
1.5%
Dockerfile
1.0%
🎙️ Detects whether a voice recording is AI-generated or Human across 5 Indian languages.
| Model | Purpose | Accuracy |
|---|---|---|
MelodyMachine/Deepfake-audio-detection-V2 | AI/Human Detection | 99.73% |
speechbrain/lang-id-voxlingua107-ecapa | Language Detection | 93.3% |
pip install -r requirements.txt
The models are not included in the repo due to size. Download them first:
# Create models directory
mkdir -p models/deepfake_detector
# Download deepfake detection model from HuggingFace
python -c "
from transformers import Wav2Vec2ForSequenceClassification, Wav2Vec2FeatureExtractor
model_name = 'MelodyMachine/Deepfake-audio-detection-V2'
save_path = './models/deepfake_detector'
print('Downloading model...')
model = Wav2Vec2ForSequenceClassification.from_pretrained(model_name)
feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(model_name)
model.save_pretrained(save_path)
feature_extractor.save_pretrained(save_path)
print(f'Model saved to {save_path}')
"
# Using uvicorn directly
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Or using the run script
chmod +x run.sh
./run.sh
curl -X POST https://your-domain.com/api/voice-detection \
-H "Content-Type: application/json" \
-H "x-api-key: sk_test_123456789" \
-d '{
"language": "Tamil",
"audioFormat": "mp3",
"audioBase64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU2LjM2LjEwMAAAAAAA..."
}'
{
"status": "success",
"language": "Tamil",
"classification": "AI_GENERATED",
"confidenceScore": 0.91,
"explanation": "Strong synthetic speech indicators detected: unnatural pitch consistency, flat energy profile. Voice clearly exhibits AI-generated characteristics."
}
{
"status": "error",
"message": "Invalid API key or malformed request"
}
All requests require an API key via the x-api-key header.
Default API Key (for testing): sk_test_123456789
aivoice_detection/
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI entry point
│ ├── config.py # Configuration settings
│ ├── routes/
│ │ └── voice_detection.py
│ ├── services/
│ │ ├── audio_processor.py
│ │ ├── language_detector.py
│ │ ├── deepfake_detector.py
│ │ └── explanation_generator.py
│ ├── models/
│ │ └── schemas.py
│ └── middleware/
│ └── auth.py
├── tests/
│ └── test_api.py
├── requirements.txt
├── .env
└── README.md
# Run tests
pytest tests/ -v
# Run with coverage
pytest tests/ -v --cov=app
# Build image
docker build -t ai-voice-detection .
# Run container
docker run -p 8000:8000 ai-voice-detection
The API provides detailed explanations based on audio analysis:
MIT License
1 commits
Python
69.8%
HTML
27.6%
Shell
1.5%
Dockerfile
1.0%