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

Vosk integration with Freeswitch - mod_vosk - what is the status?

Open lafar6502 opened this issue 2 years ago • 8 comments

Hi, i would like to try Vosk with Freeswitch for some automatic keyword recognition in voip calls (yes, no, numbers, etc) and see how far i get. But it's a bit unclear to me what is the supported integration approach for Freeswitch About 2 years ago you tried to merge a pull request for 'mod_vosk' into Freeswitch repo, but in the discussion that followed you decided to host it as independent project / git repo instead. But i cant find any such project (mod_vosk). Does it exist at all? Or have you decided to go with some different approach? What is the easiest way to connect Vosk engine with Freeswitch?

Best regards Rafal

lafar6502 avatar Jun 06 '22 12:06 lafar6502

Our integration code reside here, you can simply build it yourself:

https://github.com/alphacep/freeswitch/tree/master/src/mod/asr_tts/mod_vosk

You also need alphacep/libks. The pull request for vosk into freeswitch is still pending due to libks things:

https://github.com/signalwire/freeswitch/pull/578

https://github.com/signalwire/libks/pull/74

nshmyrev avatar Jun 06 '22 12:06 nshmyrev

You can also use vosk unimrcp server instead and freeswitch unimrcp plugin:

https://github.com/alphacep/unimrcp-vosk-plugin/tree/vosk-plugin

nshmyrev avatar Jun 06 '22 12:06 nshmyrev

Thanks!

lafar6502 avatar Jun 06 '22 12:06 lafar6502

@nshmyrev I am trying to build mod_vost with freeswitch 1.10.7 but getting the following error when I try to load the module

[CRIT] switch_loadable_module.c:1750 Error Loading module /usr/local/freeswitch/mod/mod_vosk.so
**/usr/local/freeswitch/mod/mod_vosk.so: undefined symbol: __ks_json_add_string_to_object**

cyrenity avatar Feb 23 '23 01:02 cyrenity

@nshmyrev I am trying to build mod_vost with freeswitch 1.10.7 but getting the following error when I try to load the module

[CRIT] switch_loadable_module.c:1750 Error Loading module /usr/local/freeswitch/mod/mod_vosk.so
**/usr/local/freeswitch/mod/mod_vosk.so: undefined symbol: __ks_json_add_string_to_object**

I have the same problem, did you manage to solve it?

andreslavariega avatar May 24 '23 20:05 andreslavariega

@andreslavariega feels like you are using wrong libks, we have our own version with fixes https://github.com/alphacep/libks

nshmyrev avatar May 24 '23 20:05 nshmyrev

@andreslavariega feels like you are using wrong libks, we have our own version with fixes https://github.com/alphacep/libks

@nshmyrev Thanks for your prompt response. I tell you my steps.

I deleted libks and then installed libks from the indicated source code.

Use these commands, and previously install cmake 3.7.2.

cmake . -DCMAKE_INSTALL_PREFIX:PATH=/usr make cd /usr/src/libks/ cmake . make make install

Then I ran the test successfully.

root@voskFreeSwitch:/usr/src/libks# ctest . Test project /usr/src/libks Start 1: test pools 1/17 Test #1: testpools..................... Passed 0.02 sec Start 2: testrealloc 2/17 Test #2: testrealloc .................. Passed 0.02 sec Start 3: testacl 3/17 Test #3: testacl .................. Passed 0.02 sec Start 4: testthreadpools

However, when I want to compile the freeswitch again, I get the error that it can't find libks. I think it's because I didn't install it in the correct folder, or maybe I should reference it at compile time.

checking for libks >= 1.8.2... configure: error: You need to either install libks

andreslavariega avatar May 25 '23 01:05 andreslavariega

You need to read details in configure.log, it should be clear why there is no libks. Check inside or attach it here.

nshmyrev avatar May 25 '23 13:05 nshmyrev