Skip to content

A telegram bot to convert news site urls into mp3 files (voiced with SAPI).

License

Notifications You must be signed in to change notification settings

sentenzo/narrator

Repository files navigation

Narrator

Screenshot

A personal use telegram bot to generate MP3 files based on text from the webpage.

About

How it works

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:

Why I made it

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.

Building

Software requirements

  • OS Windows 10 (the bot uses SAPI5 only available on Windows)

  • python3.10

  • 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

First run

  1. In the project directory execute:

    poetry install

    - to download all the Python packages required.

  2. 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.

  3. In config.yml in utils section replace the mock paths with the real ones.

  4. Either in .env or in config.yml you should specify the telegram usernames allowed to communicate with the bot.

  5. Run make run to launch the bot.

Licensing

  • 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)