feat(voice): transcribe Telegram voice notes with SpeechRecognition

Add a voice message handler that downloads OGG audio, converts it to
WAV via pydub/ffmpeg, and transcribes it with Google Speech Recognition
(pt-BR) before feeding the text into the normal message pipeline.

Also extract shared text processing into process_text_message, guard
against updates without a text attribute, switch the default AI provider
to openrouter with deepseek-v4-flash, and document the ffmpeg system
requirement in DEPLOY.md.
This commit is contained in:
2026-10-25 17:27:42 -03:00
parent 6b3b6541a7
commit 25288d2c0f
73 changed files with 139973 additions and 38 deletions
+12 -1
View File
@@ -8,7 +8,7 @@ Deploy como serviço systemd em Debian/Ubuntu para funcionar 24/7 em VPS.
```bash
sudo apt update
sudo apt install -y python3 python3-venv python3-pip git
sudo apt install -y python3 python3-venv python3-pip git ffmpeg
```
Habilite o journal se quiser logs persistentes (opcional):
@@ -72,6 +72,9 @@ Ajuste opcionalmente:
## 3) Instale as dependências
```bash
sudo apt install -y ffmpeg
```bash
chmod +x iniciar.sh
./iniciar.sh
@@ -79,6 +82,14 @@ chmod +x iniciar.sh
Esse script cria o `venv`, instala dependências e valida as variáveis do `.env`.
Se o comando acima não instalar `ffmpeg` na versão esperada, use também:
```bash
sudo apt install -y ffmpeg
```
> O reconhecimento de voz usa `SpeechRecognition` + `pydub` + `ffmpeg`.
---
## 4) Instale o serviço systemd