d4sein / Speech-Recognition-Bot

A Discord bot that works with voice commands.
MIT License
46 stars 34 forks source link

First try #3

Open Frettarix opened 3 years ago

Frettarix commented 3 years ago

When trying your bot on the first try after connecting it, when I say "Bumblebee search ..." it'll crash immediately:

Error: Output stream closed at Timeout._onTimeout (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:491:25) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) Emitted 'error' event on FfmpegCommand instance at: at emitEnd (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:424:16) at Timeout._onTimeout (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:491:17) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

RenzoHeredia commented 3 years ago

can you fixed the problem?

Frettarix commented 3 years ago

I'm not fixing the problem, this software has a non-free dependency so I'm not using this myself.

ii-apache commented 2 years ago

When trying your bot on the first try after connecting it, when I say "Bumblebee search ..." it'll crash immediately:

Error: Output stream closed at Timeout._onTimeout (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:491:25) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) Emitted 'error' event on FfmpegCommand instance at: at emitEnd (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:424:16) at Timeout._onTimeout (D:\Temp\npm_aura\Speech-Recognition-Bot-master\node_modules\fluent-ffmpeg\lib\processor.js:491:17) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

Has anyone fixed this problem?

SystemOneZero commented 1 year ago

I'm actually working on a recog thing myself, i think the issue is the discord bots has changed a lot under the hood. Trying to figure out what may work now. This is actually a non caught error which should have been handled in well written code, but most likely it is due to the fact this doesn't work properly anymore. But anyhow if you can make this work, or if you find a better way to just record from a keyword like this im all ears.

Frettarix commented 1 year ago

I've had a Proof of Concept that was working. A simple web application with native javascript where you can record audio to a file. Then you need to host a speech recognition server with an endpoint that can receive files and returns text. 'Simply' send the files there.

Such a design may also be better for a bigger project as your speech server and recorder are micro-services. There are certain python libraries as well that allow speech recognition (https://pypi.org/project/SpeechRecognition/).

SystemOneZero commented 1 year ago

Yea unfortunately, it has to be in app, I also recently had an idea to use web front end, and it works. But I wanted to avoid using outside things. And it seems discord is not encouraging recording as such. I know speech recog works, and I already have an example, i tried using this in app, but this is a no go. So trying to figure things out there. But you are right speechrecog or webkit speech works. It's just a matter of getting that to run client side inside discord that is the problem. And i kinda hit a wall atm. I was thinking of how to maybe embed a file that runs from the app, but this seems to be discouraged as well, since its most likely a security issue.

But ty for the suggestion.

On Wed, Jun 14, 2023 at 10:33 PM Frettarix @.***> wrote:

I've had a Proof of Concept that was working. A simple web application with native javascript where you can record audio to a file. Then you need to host a speech recognition server with an endpoint that can receive files and returns text. 'Simply' send the files there.

Such a design may also be better for a bigger project as your speech server and recorder are micro-services. There are certain python libraries as well that allow speech recognition ( https://pypi.org/project/SpeechRecognition/).

— Reply to this email directly, view it on GitHub https://github.com/d4sein/Speech-Recognition-Bot/issues/3#issuecomment-1591940328, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIWIN54MFFD3EAA3A5SQ3LXLINY7ANCNFSM446XMNIA . You are receiving this because you commented.Message ID: @.***>

Frettarix commented 1 year ago

If you're trying to implement this on Discord I can probably give you some example libraries that can help. I've got voice recognition on Discord already.

For a front-end I still need to build it though, been lacking time due to work :D

SystemOneZero commented 1 year ago

Sure, most of the examples i got does not work currently with discord. Any help would be appreciated.

Frettarix commented 1 year ago

I forgot that I got a new computer and I've lost all my data.... the implementation I did was based on a free model applied to a discord bot (similar to https://www.youtube.com/watch?v=IKIlnaCDZcI&ab_channel=omega7arts).

You want to set up a discord bot that can connect to the voice chat and listen, then each user will be seen as a separate input for the vosk model. It's not 100% accurate but it may do the job.

SystemOneZero commented 1 year ago

I forgot that I got a new computer and I've lost all my data.... the implementation I did was based on a free model applied to a discord bot (similar to https://www.youtube.com/watch?v=IKIlnaCDZcI&ab_channel=omega7arts).

You want to set up a discord bot that can connect to the voice chat and listen, then each user will be seen as a separate input for the vosk model. It's not 100% accurate but it may do the job.

Ah very cool, ill give this a shot, otherwise ill either have to try maybe a web front end, or write some kinda half exploity way that works with discord, their code and documentation does seem a bit well... fastly written, not sloppy per say, but also not really helpful to the people that want to create things for discord. And didn't code it themselves.