Rei-x / discord-speech-recognition

Speech to text extension for discord.js
https://npmjs.com/package/discord-speech-recognition
MIT License
56 stars 22 forks source link

Speech-recognition libraries support #55

Closed mbarretol closed 1 year ago

mbarretol commented 1 year ago

It would be awesome if there were other speech-recognition libraries supported, maybe even Vosk and Whisper. I know that Vosk supports real-time transcription, but the official Whisper library does not.

Rei-x commented 1 year ago

I don't plan to add more speech recognition libraries (more code to maintain, tests to debug etc.), because majority of developers uses default speech recognition library.

If more developers need support for other libraries then I will consider it

If you want to use external library for speech recognition it's possible, you jest need to specify your speech recognition function:

addSpeechEvent(client, {
  speechRecognition: (audioBuffer) => {
      // recognize speech with library of your choice
      // ...
      return text;
  }
});

You can see more details how to write your own speech recognition function by looking at witai code: https://github.com/Rei-x/discord-speech-recognition/blob/main/src/speechRecognition/witai.ts