A Telegram bot for collecting voice recordings from consenting users to train speech AI models.
Create a bot via @BotFather and copy the token.
cp .env.example .env
# Edit .env and set BOT_TOKEN=your_token_herepip install -r requirements.txt
export BOT_TOKEN=your_token_here # or use a .env loader
python bot.pydocker build -t voice-bot .
docker run -d \
--name voice-bot \
--restart unless-stopped \
-e BOT_TOKEN=your_token_here \
-v $(pwd)/data:/app/data \
voice-bot# From a text file (one sentence per line)
python import_sentences.py sentences.txt
# From a JSON file
python import_sentences.py sentences.jsonJSON format:
[
{"text": "Hello world.", "normalized_text": "hello world"},
{"text": "How are you?", "normalized_text": "how are you"}
]Send /admin to the bot to see overall statistics (total users, recordings, audio duration).
data/
recordings.db ← SQLite database
voices/ ← Confirmed .ogg recordings + .json sidecars
temp/ ← Pending (unconfirmed) recordings — auto-cleaned on re-record
/start→ consent agreement shown- User accepts → phone or username registration
- User taps Record a sentence → sees original + normalized text
- User sends a voice message → listens back → confirms or re-records
- Confirmed recordings are saved to
data/voices/