A personal use telegram bot to generate MP3 files based on text from the webpage.
You drop a url — you get an mp3, voiced by either "Microsoft Irina Desktop" (if it's in Russian) or "Microsoft Zira Desktop" (if it's in English).
Additional feature: You also can drop a file of a supported format.
It uses a plenty of third party software:
- blb2txt — to extract text from the various types of files
- balcon — to voice the text with Microsoft Speech API (SAPI)
- ffmpeg — to perform
.wav
→.mp3
conversion
I really like Microsoft voice engines among all the others, and I'd like to have a tool to voice small news articles using only smartphone (at least on the client side).
This bot was designed for personal usage. It is assumed to never have more than 3-5 active users.
-
OS Windows 10 (the bot uses SAPI5 only available on Windows)
-
make tool — for build-automation. To install it on Windows, one can try GNU make 4.3 package from the Chocolatey package manager.
-
Poetry — to administer Python dependencies.
-
blb2txt — (optional) to convert from various doctypes to
.txt
-
balcon — to perform
.txt
→.wav
conversion -
ffmpeg — to perform
.wav
→.mp3
conversion
-
In the project directory execute:
poetry install
- to download all the Python packages required.
-
Rename the
example.env
file into.env
. Replace the dummy values in it with real ones.Alternatively you can declare the values from
.env
as environment variables. -
In
config.yml
inutils
section replace the mock paths with the real ones. -
Either in
.env
or inconfig.yml
you should specify the telegram usernames allowed to communicate with the bot. -
Run
make run
to launch the bot.
- Current repository is licensed under MIT License
- the external utilities:
- ffmpeg is licensed under a mixed license, compatible with MIT License
- balcon and blb2txt are distributed under a custom freeware license, compatible with MIT License (with some caveots)