Code Monkey home page Code Monkey logo

unimrcp_experiments's Introduction

unimrcp_experiments

Overview

Here we have a Dockerfile to create a container that will host unimrcp and swig-wrapper.

Preparation

You will need to have docker and jq installed:

apt install git docker jq

You will need to have unimrcp and swig-wrapper git repo clones at the same level as this repo.

Basically, fork unimrcp and swig-wrapper to your github account and then do:

cd src
git clone https://github.com/YOUR_NAME/unimrcp
git clone https://github.com/YOUR_NAME/swig-wrapper

So that you end up with this:

src
    \unimrcp_experiments
    \unimrcp
    \swig-wrapper 

Building the image

To build the container image:

./build_image.sh

Starting the container

To start the container do:

./start_container.sh

The container will be started with '--network host' so that we can use mrcp clients running outside the container and listen to audio generated by unimrcp.

Bulding unimrcp and swig-wrapper inside the container

At the first time or whenever unimrcp or swig-wrapper code changes do:

./prepare_unimrcp_and_swig-wrapper.sh

Starting a working session

To simplify opening apps, there is a tmuxinator session definition file that can be used like this:

cd ~/host/unimrcp_experiments
tmuxinator start -p unimrcp_dev.yml

The above will open a tmux session and will start unimrcpserver and sngrep with MRCP parsing support.

Testing with mrcp_client:

Outside the container (so that you can have access to audio devices), you can use an MRCP client like https://github.com/MayamaTakeshi/mrcp_client

and test Speech Synth:

node speechsynth_client.js 127.0.0.1 8060 en-US somevoice "Hello World"

or Speech Recog:

node speechrecog_client.js 127.0.0.1 8060 en-US artifacts/hello_there.wav builtin:speech/transcribe

However the above will actually generate dummy results as unimrcpserver is configured to use the demo synth and demo recog plugins.

Testing with umc

Inside the container you can test with umc. Start it like this:

cd /usr/local/unimrcp/bin
./umc

Then execute commands like:

run synth

or

run recog

Building minimal_app

To build the minimal_app (the app does nothing. It is just a build smoke test) do:

takeshi@unimrcp_dev:~$ cd ~/host/unimrcp_experiments/minimal_app/
takeshi@unimrcp_dev:~/host/unimrcp_experiments/minimal_app$ 

takeshi@unimrcp_dev:~/host/unimrcp_experiments/minimal_app$ rm CMakeCache.txt CMakeFiles/ cmake_install.cmake -fr
takeshi@unimrcp_dev:~/host/unimrcp_experiments/minimal_app$ cmake -D USER=`whoami` .
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/takeshi/host/unimrcp_experiments/minimal_app
takeshi@unimrcp_dev:~/host/unimrcp_experiments/minimal_app$ make
Scanning dependencies of target app
[ 50%] Building C object CMakeFiles/app.dir/main.c.o
[100%] Linking C executable app
[100%] Built target app

You can run the app by doing:

takeshi@unimrcp_dev:~/host/unimrcp_experiments/minimal_app$ ./app 
OK

Testing with swig-wrapper

To test Speech Synth with the swig-wrapper for python do:

PYTHONPATH=~/src/swig-wrapper/Python/wrapper ~/src/unimrcp_experiments/UniSynth.py "hello"

The above will produce a file UniSynth.pcm that you can move to a folder visible to the host and then you can use

ffplay -f s16le -ar 8k -ac 1 UniSynth.pcm 

in the host to hear it.

Then to test Speech Recog with the swig-wrapper for python do:

PYTHONPATH=~/src/swig-wrapper/Python/wrapper ~/src/unimrcp_experiments/UniRecog.py /usr/local/unimrcp/data/grammar.xml UniSynth.pcm

But again, the output for both synth and recog is bogus as we are using the demo plugins.

unimrcp_experiments's People

Contributors

mayamatakeshi avatar

Watchers

 avatar  avatar

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.