Code Monkey home page Code Monkey logo

rantovox-telegram-bot's Introduction

RantoVox (Telegram bot)

Telegram bot based on Python 3 for running Speech-To-Text (STT) and Text-To-Speech (TTS) queries. Languages supported: Russian, English (queries and interface).

Stack

Used modules

Module for working with Telegram API: Aiogram.

Software for converting audio files into different formats: FFmpeg.

STT and TTS queries are performed using the following libraries:

Bot supports two voices (male and female), whose names are set in the configuration file.

Extra Text Processing (ETP)

Bot has a special function called extra_text_processing, which introduces additional methods of processing text received from Vosk. By going through it, the text can be made more human and correct in terms of writing. The materials required for this function are stored strictly in the src/etp.

Installation

Note: Created and tested on Windows platform, Python 3.11.4

Installation manual

The following steps are required for RantoVox to work correctly:

  1. Clone the repository (download source code)

  2. Create a virtual environment using python -m venv venv and activate it

  3. Install dependencies using pip with requirements.txt

  4. Download latest vosk russian and english language models (the small model is more preferable), drop them into src/lang (You can use make download to automatically download and post, requires curl and tar)

  5. Create your own .env file in root folder with variables described in Environment file section.

Cloning repository and installing requirements

git clone https://github.com/Ggorets0dev/rantovox-telegram-bot.git
cd rantovox-telegram-bot
pip install -r requirements.txt

Usage

Commands

The following commands are available in RantoVox:

  • start - Launch a bot for your account

  • help - Get an informational summary of the operating principles

  • setlocale - Set language of bot's interface

  • setvoice - Set voice gender for requests (TTS)

  • setlang - Set language for requests (STT)

Environment file

A .env file with the following variables must be created before running the bot:

Name Example Default Description
TELEGRAM_TOKEN 1234567890:ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghi - Access token to the created Telegram bot
MALE_VOICE_NAME Aleskandr - Name of the voice to be used in the male voiceover
FEMALE_VOICE_NAME Elena - Name of the voice to be used in the female voiceover
RU_LANG_MODEL_DIRNAME vosk-model-small-ru-0.22 - Name of folder with Russian language model (should be in src/lang)
ENG_LANG_MODEL_DIRNAME vosk-model-small-en-us-0.15 - Name of folder with Russian language model (should be in src/lang)
MAX_REQUEST_INDEX 100 1000 A value from the range 0 - n will be assigned to the temporarily created files (affects the number of simultaneously served clients)
ETP_ENABLED False True Whether post processing of the raw text from the conversion will be used

Note: Default - value that the bot will take on its own if the value is in the wrong format in the environment file

Note: Call the bot for a list of available votes, filling in all remaining variables. It will display a list of available values (be careful: not all voices support Russian and English at the same time)

Privacy

Bot deletes all temporary files immediately after a TTS or STT request. All conversion is done on the host with the help of the libraries described above. Only user's Login and ID are recorded in logs when requesting, composition of request remains hidden to host.

rantovox-telegram-bot's People

Contributors

ggorets0dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.