Giter VIP home page Giter VIP logo

inevolin / discordearsbot Goto Github PK

View Code? Open in Web Editor NEW
64.0 4.0 324.0 39.49 MB

A speech-to-text framework and bot for Discord. Take control of your Discord server using speech and voice commands. Can also be useful for hearing impaired and deaf people.

License: MIT License

JavaScript 99.86% Procfile 0.14%
speech-recognition discord-bot speech-to-text speech-synthesis speech-processing speech discord discord-js stt hearing-aids hearing-impaired

discordearsbot's Introduction

DiscordEarsBot

A speech-to-text bot for Discord written in NodeJS. Can be useful for hearing impaired and deaf people.

Getting Started:

Discord Ears Bot Demo

Installation Tutorial

YouTube: https://www.youtube.com/watch?v=IKIlnaCDZcI

Try the bot for yourself on our Discord server: https://discord.gg/ApdTMG9

Developers

Setup

In your Discord Developers Bot settings, you need to enable these intents:

image

Manual Installation

You need nodeJS version +16 with npm on your machine, use node -v to check your version. Execute the following commands:

git clone https://github.com/healzer/DiscordEarsBot.git
cd DiscordEarsBot
npm install

Provide the Discord API Token using DISCORD_TOK Env Variable or in settings.json.

Finally run node index.js. You can also use pm2 or nodemon to keep the bot running 24/7.

Heroku

If you don't have a linux server/machine then you can use Heroku for hosting your bot 24/7 and it's free.

  1. Fork this GitHub repository
  2. Create Discord Bot, Invite it to your server and get the API Token
  3. Create new Heroku app, use the GitHub method and Deploy DiscordEarsBot
  4. Under "resources" disable "web" and enable "worker" dyno instead.
  5. Provide the DISCORD_TOK Config Var under "settings"

Usage

By now you have a discord server, the DiscordEarsBot is running and is a part of your server. Make sure your server has a text and voice channel.

  1. Enter one of your voice channels.
  2. In one of your text channels type: *join, the bot will join the voice channel.
  3. Everything said within that channel will be transcribed into text (as long as the bot is within the voice channel).
  4. Type *leave to make the bot leave the voice channel.
  5. Type *help for a list of commands.

notes:

  • When the bot is inside a voice channel it listens to all speech and transcribes audio into text.
  • Each user is a separate audio channel, the bot hears everyone separately.
  • Only when your user picture turns green in the voice channel will the bot receive your audio.
  • A long pause interrupts the audio input.
  • For Google Speech & WitAI: The duration of a single audio input is limited to 20 seconds, longer audio is not transcribed.

Speech Services

Speech to Text Discord Bot

YouTube comparison and tutorial for developers on choosing the right Speech API: https://www.youtube.com/watch?v=fQcEZIgw_LA

Vosk API

This is our default Speech-to-Text method. The Vosk API is a free & open-source solution that runs locally (offline). By default only english is enabled. Developers can change or include more language models from here: https://alphacephei.com/vosk/models

WitAI

Installation:

  1. set SPEECH_METHOD to witai
  2. use your Server Access Token for WITAI_TOK

WitAI supports over 120 languages (https://wit.ai/faq), however only one language can be used at a time. If you're not speaking English on Discord, then change your default language on WitAI under "settings" for your app.

You can also change the language using the following bot command: *lang <code> <code> should be an ISO 639-1 language code (2 digits): https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

Google Speech API

You can use Google's Speech-to-Text API as follows:

  1. set SPEECH_METHOD to google
  2. For non-English transcriptions: open index.js, inside the function transcribe_gspeech change the value of languageCode.
  3. Enable Google Speech API here: https://console.cloud.google.com/apis/library/speech.googleapis.com
  4. Create a new Service Account (or use your existing one): https://console.cloud.google.com/apis/credentials
  5. Create a new Service Account Key (or use existing) and download the json file.
  6. Put the json file inside your bot directory and rename it to gspeech_key.json.

Mozilla DeepSpeech (experimental)

Using Mozilla DeepSpeech for speech recognition, tutorial.

Contact

For enquiries or issues get in touch with me:

Name: Ilya Nevolin

Email: [email protected]

Discord: https://discord.gg/ApdTMG9

discordearsbot's People

Contributors

benroyz avatar dependabot[bot] avatar inevolin avatar thorulf4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

discordearsbot's Issues

Node.js just released v21.6.0 and it's breaking the build/compile. Fix listed.

Node.js just released v21.6.0 and it's breaking the build/compile. Fix listed. #11

Change the following:

DiscordEarsBot > package.json > "node": "<21.6.0"

Now, the build log successfully completed. Output:

-----> Installing binaries
       engines.node (package.json):  <21.6.0
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version <21.6.0...
       Downloading and installing node 21.5.0...
       Using default npm version: 10.2.4

I think the issue is ffi-napi compatibility with the new node.js version.

that thing doesnt even work.

I tried everything and this thing didnt even worked.

2022-06-19T14:04:39.605288+00:00 app[worker.1]: FATAL ERROR: Error::ThrowAsJavaScriptException napi_throw 2022-06-19T14:04:39.606415+00:00 app[worker.1]: 1: 0xb65080 node::Abort() [node] 2022-06-19T14:04:39.608808+00:00 app[worker.1]: 2: 0xa761b5 node::FatalError(char const*, char const*) [node] 2022-06-19T14:04:39.609610+00:00 app[worker.1]: 3: 0xa761be [node] 2022-06-19T14:04:39.610395+00:00 app[worker.1]: 4: 0xb2eeb3 napi_fatal_error [node] 2022-06-19T14:04:39.610527+00:00 app[worker.1]: 5: 0x7f5fdb01dc8e [/app/node_modules/discord.js/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.31/opus.node] 2022-06-19T14:04:39.610666+00:00 app[worker.1]: 6: 0x7f5fdb01e3ec Napi::Error::ThrowAsJavaScriptException() const [/app/node_modules/discord.js/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.31/opus.node] 2022-06-19T14:04:39.610818+00:00 app[worker.1]: 7: 0x7f5fdb02ad68 OpusEncoder::Decode(Napi::CallbackInfo const&) [/app/node_modules/discord.js/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.31/opus.node] 2022-06-19T14:04:39.610940+00:00 app[worker.1]: 8: 0x7f5fdb0212da Napi::InstanceWrap<OpusEncoder>::InstanceMethodCallbackWrapper(napi_env__*, napi_callback_info__*) [/app/node_modules/discord.js/node_modules/@discordjs/opus/prebuild/node-v108-napi-v3-linux-x64-glibc-2.31/opus.node] 2022-06-19T14:04:39.611699+00:00 app[worker.1]: 9: 0xb0e10d [node] 2022-06-19T14:04:39.612625+00:00 app[worker.1]: 10: 0xdb2dd0 [node] 2022-06-19T14:04:39.613564+00:00 app[worker.1]: 11: 0xdb430f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node] 2022-06-19T14:04:39.614997+00:00 app[worker.1]: 12: 0x16f5cf9 [node]

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.