Giter Club home page Giter Club logo

mod_vosk's Introduction

This is a module to recognize speech using Vosk server. You can run the server in docker with simple:

docker run -d -p 2700:2700 alphacep/kaldi-en:latest

See for more details https://github.com/alphacep/vosk-server

To use this server with freeswitch:

  1. Make sure you have libks installed
  2. Configure and install freeswitch including mod_vosk.so
  3. Make sure mod_vosk.so is enabled in modules.conf.xml and conf/vosk.conf.xml is placed in autoload_configs

Run the following sample dialplan:

<include>
  <context name="default">
    <extension name="asr_demo">
        <condition field="destination_number" expression="^.*$">
          <action application="answer"/>
          <action application="play_and_detect_speech" data="ivr/ivr-welcome.wav detect:vosk default"/>
          <action application="speak" data="tts_commandline|espeak|You said ${detect_speech_result}!"/>
        </condition>
    </extension>
  </context>
</include>

!!!! ATTENTION, for reliable work this module requires several fixes in libks which are not yet merged, so rebuild libks from this:

git clone --branch vosk-fix --single-branch https://github.com/alphacep/libks

You can create more advanced dialplans with ESL and scripts in various languages. See examples in scripts folder.

!!! ATTENTION In order for ESL to recieve events, make sure that fire_asr_events variable is set to true (false by default). The dialplan can look like this:

<include>
  <context name="default">
    <extension name="asr_demo">
        <condition field="destination_number" expression="^.*$">
          <action application="answer"/>
          <action application="set" data="fire_asr_events=true"/>
          <action application="detect_speech" data="vosk default default"/>
          <action application="sleep" data="10000000"/>
        </condition>
    </extension>
  </context>
</include>

mod_vosk's People

Contributors

igwtech avatar

Watchers

 avatar

Forkers

lonelyxmas zhq1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.