Giter Site home page Giter Site logo

speech2textbot's Introduction

Speech2Text telegram bot (via telepot) v.2.0

This is light demo of Telethon, Yandex Speech Kit and telegram capabilities to improve your life a bit. You can run this bot and recognize annoying audio messages to text if you dislike them or simply can't listen right away.

Demo

You can try @sp2txt_bot yourself. Just record a voice message, or forward one and wait couple of seconds.

Installation

  1. Get your Yandex.SpeechKit API key at Yandex Developer Center. Paste it inside
  2. Make sure Bot Father approves of your intentation to create another bot. If so, get a token.
  3. Install dependencies required for audio processing.
$ sudo apt-get update && apt-get install ffmpeg 
# or, for Mac
$ brew install ffmpeg

Installation tested on Debian Wheezy and Ubuntu 16.04. If you have troubles with opus-tools, check out notes below.

  1. Install dependancies and run bot with:
$ git clone https://github.com/Hiyorimi/speech2textbot.git
$ cd speech2textbot
$ cp env_example .env
$ pipenv shell
(speech2textbot)$ pipenv install

You can also paste key directly in code, it's a bit dirty. In that case, provide a token when launching a bot

$ sed -i "s/SPEECH_KIT_API\ \=\ ''/SPEECH_KIT_API\ \=\ 'your-yandex-speech-kit-api-here'/g" speech2textbot.py

On Mac you should add '' after -i:

$ sed -i '' "s/\=\ ''/\=\ 'your-yandex-speech-kit-api-here'/g" speech2textbot.py

Running

(speech2textbot)$ python speech2textbot.py

Docker

$ docker build -t speech2txtbot_docker .
$ docker run -d --name=speech2txtbot speech2txtbot_docker

Docker debug

docker run -d --name=speech2txtbot speech2txtbot_docker /bin/sh -c "while true; do sleep 2; df -h; done"
docker exec -it speech2txtbot /bin/sh

Final

I would be grateful for any ideas for improvement, feel free to fork, copy and modify.

Analytics

You can register your BOTAN_TOKEN at @Botaniobot to track bot users. Don't forget to include token into your .env file.

OPUS installation

If you can't build audiotools and fail to install opus-tools and opusfile from packages, you might want to build OPUS from source.

Since there is no installation guide, some tips. First of all, install system libs:

$ apt-get install vorbis-tools libogg-dev  libmpg123 libmp3lame-dev libmp3lame0 ffmpeg
  1. Get opus, opus-tools and opusfile archives, unpack them with tar -xzf [file]
  2. cd into directory and run
$ ./configure
$ ./make
$ ./make install

You might need to install additional dependencies.

speech2textbot's People

Contributors

hiyorimi avatar sobolevn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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