Skip to content

akscf/mod_whisper_asr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Provides offline speech recognition features for the Freeswitch.
Was developed just as a gizmo to checking/playing with the Whisper capabilities.
Not suitable for production use in this view! (see whisperd for that case)

Pay attention on the following:
Seems Freeeswith (or APR) has a trouble with dynamic modules that contains c++ code (haven't investigate it yet deeply).
After the first loading you can longer unload it completely! (something still continue keeping it somewhere)
It can be repeated (for instance, take the mod_whisper_asr):

  • load mod_whisper_asr
  • unload mod_whisper_asr
  • now, go to the Freeswitch modules dir and delete/move this module away
  • the following attempt to load this unavailable module will complete with success!
    there is an only way to solve it - it's reload the Freeswitch

Got it on: FreeSWITCH Version 1.10.10-release~64bit, but haven't tested on other versions,
maybe it's an old and well known bug but I stumbled upon it for the first time in this module (never used c++ with Freeswitch) and I takes me plenty of time to figure out what's going on...

Usage example

<extension name="asr-tets">
 <condition field="destination_number" expression="^(3222)$">
    <action application="answer"/>
    <action application="sleep" data="1000"/>
    <action application="play_and_detect_speech" data="/tmp/test2.wav detect:whisper {lang=en}"/>
    <action application="log" data="CRIT SPEECH_RESULT=${detect_speech_result}"/>
    <action application="sleep" data="1000"/>
    <action application="hangup"/>
 </condition>
</extension>

# using freeswitch packages
apt update ; apt install libfreeswitch-dev libfreeswitch1 libfreeswitch1-dbg
cd mod_whisper_asr/sources
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
make install