The Mod9 ASR C++ Library and the example should be compatible with C++11 onward. It has been tested
with gcc 4.8.5 and gcc 8.4.0 on Ubuntu and RedHat Linux, but it should work with many other
compilers and OSes. Note that on non-Linux systems, the various "write()" calls cannot detect if the
remote Engine disconnects, and will therefore not throw an exception in this case.

A Makefile is provided, which requires the "make" tool.

The Library and the example require the nlohmann_json library, which is included in the distribution.
See https://github.com/nlohmann/json for information about it. Programs that use the Mod9 ASR C++
Library will generally want to use a JSON library, but it need not be nlohmann_json.


To build the Library as a static ".a" file, go to the top level directory and type:

  make static

To build as a shared ".so" file:

  make shared

We recommend the static build, as shared builds have additional runtime complexity.


We provide an example of using the Library in the directory "example". It's also a good introduction
to the Library itself, introducing concepts gradually, up to a full featured recognition request. It
also demonstrates additional functionality to stream raw audio, handle exceptions, apply timeouts,
and abort requests.

To build the example:

  cd example
  make clean
  make

To run the example:

  curl -sL -O mod9.io/hi.wav -O mod9.io/hi-8k.mulaw
  ./mod9-asr-example mod9.io 9900 hi.wav hi-8k.mulaw

Note that mod9.io server is for demonstration purposes only. Although received data is not stored,
the connection is not secure, so private or sensitive data should not be sent to this server.
In general, operators are expected to deploy their own ASR Engine on a secure local network.

To build the Library with gcc-4.8.5, the easiest approach is to use RHEL/CentOS 7. See the Dockerfile.
