alphacep / vosk-asterisk

Speech Recognition in Asterisk with Vosk Server
GNU General Public License v2.0
102 stars 40 forks source link

Set Language #35

Open pumanzor opened 1 year ago

pumanzor commented 1 year ago

Hello, where is the file or how i can change the language, i'm wondering if this file

res_speech_vosk.conf

does support this variable, but also is possible on dialplan something like that:

same = n,Set(SPEECH_ENGINE(VOSK_CONFIG)={"config" : { "languageCode" : es"} })

thanks for your help

nshmyrev commented 1 year ago

This feature is not implemented, we have pull request https://github.com/alphacep/vosk-asterisk/pull/8 about it.

vieridipaola commented 1 year ago

Does the pull request imply that the upstream Asterisk res_http_websocket.c be modified?

Also there are "conflicts that need to be resolved" according to github. Is the code too old (almost 3 years old) as res_speech_vosk.c has been changed a year ago?

Is the pull request overkill in that it does more than just select the language?

Vosk works nicely from CLI. That's the only thing I've tried for now. I'm starting to test Asterisk integration with the Docker server container. I'm only interested in using 2 or 4 languages. Is there a way to quickly do so? Even if I had to make some code change, would it be in the Asterisk Vosk module or in the Vosk server (https://github.com/alphacep/vosk-server)?

nshmyrev commented 1 year ago

Even if I had to make some code change, would it be in the Asterisk Vosk module or in the Vosk server (https://github.com/alphacep/vosk-server)?

It has to be both

vieridipaola commented 1 year ago

Novice follow-up question:

since the vosk CLI commands "work fine for me", would there be a way to use them directly from Asterisk/AGI even if that probably is less efficient? eg. in Asterisk dialplan/AGI, record user voice to a temp file then feed it to vosk CLI to get the text.

nshmyrev commented 1 year ago

@vieridipaola sure, you can use EAGI too, see example here:

https://github.com/alphacep/vosk-server/tree/master/client-samples/asterisk

vieridipaola commented 1 year ago

The eagi sample script uses the Vosk server, so it doesn't solve the language selection issue. I'll try to customize it to use the CLI programs instead.