Convert Telegram Audio Messages To Text
Ths app runs on your server and connects to your telegram account using Telegram Api (Telegram - Obtaining ApiId and ApiHash) and when you send or receive voice messages in group or personal chats, program recognizes text and writes it in chat as your messages with mark that bot recognized this text.
- Download release or build it from sources with .Net Core 3.1
- Install FFMPEG
- Linux:
sudo apt-get install ffmpeg
- in debian based - Windows: Download binaries from FFmpeg releases and put it to app's folder (ffmpeg.exe must be in same folder as TGAudioToText.exe, or just set PATH variable to ffmpeg folder)
- Linux:
- Download VOSK Models and extract model folder to app folder
- Run TGAudioToText and it will create config template (TGAudioToText.cfg) in app folder
- Fill this fields in config: ModelName - VOSK model folder name TelegramPhone - Telegram phone number TelegramApiId - Telegram Api id and ApiHash TelegramApiHash Telegram - How to get ApiId and ApiHash
- Run app, at first time it will require confirmation code that will be sent to your telegram client. Enter it and all done.
In v1.1 EN/RU punctuation added from huggingface - sbert_punc_case_ru using python
To enable punctuation:
- Install latest Python 3 (For Linux VENV, PIP modules must be installed too)
- Change "PunctuationEnabled" parameter to True in TGAudioToText.cfg
- "PunctuationServer" parameter is already has default value
http://127.0.0.1:8018/
for punctuation server default port - In "punctuation" folder (in app's folder) run "punctuation-server-setup" (.cmd for Windows, .sh for Linux)
- If all is ok, start "punctuation-server" (.cmd for Windows, .sh for Linux)
- Run TGAudioToText not it can call punctuation server to punctuate text.
-
Clone this repository
-
cd into cloned folder and execute
docker build . -t tgaudio2text
It will take a while. make a tea while you wait.
-
Copy the example config file as
TGAudioToText.cfg
and modify it. Recommended to enable Puctuation, since its will be installed and running in the container with the main program. -
Create an empty
WTelegram.session
-
Run docker container in interactive mode to login
docker run \ -v ./[your model name from config]:/app/[your model name from config] \ -v ./TGAudioToText.cfg:/app/tgaudio/TGAudioToText.cfg \ -v ./WTelegram.session:/WTelegram.session \ -it tgaudio2text sh -c "/app/tgaudio/TGAudioToText"
When logged in, shutdown the container with ctrl + c
-
Run a container
docker run \ -v ./[your model name from config]:/app/[your model name from config] \ -v ./TGAudioToText.cfg:/app/tgaudio/TGAudioToText.cfg \ -v ./WTelegram.session:/WTelegram.session \ -d --restart always tgaudio2text