vosk-asterisk icon indicating copy to clipboard operation
vosk-asterisk copied to clipboard

Set Language

Open pumanzor opened this issue 1 year ago • 6 comments

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

pumanzor avatar Mar 15 '23 18:03 pumanzor

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

nshmyrev avatar Mar 15 '23 19:03 nshmyrev

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)?

vieridipaola avatar May 24 '23 10:05 vieridipaola

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

nshmyrev avatar May 24 '23 15:05 nshmyrev

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.

vieridipaola avatar May 25 '23 08:05 vieridipaola

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

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

nshmyrev avatar May 25 '23 08:05 nshmyrev

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.

vieridipaola avatar May 25 '23 08:05 vieridipaola