Tips and tutorials

Tips and tutorials for beginners and experts alike

    Interact with Formant agent using C++

    This tutorial explains interacting with the Formant agent using C++. It is built to run on Ubuntu Linux 18.04. For more details and latest information, visit our public github repo


    1. Install apt dependencies

    sudo apt-get install build-essential autoconf libtool pkg-config automake curl cmake libjsoncpp-dev

    2. Install gRPC using CMake.

    Clone the source code

    git clone -b $(curl -L
    cd grpc
    git submodule update --init

    Build and install (for cmake version 3.11 and up):

    cmake .
    sudo make install

    For earlier versions of cmake, the grpc project provides a more robust install script here

    3. Clone the Formant repository to a new location and navigate to the C++ examples

    git clone
    cd formant/examples/cpp

    4. Generate the C++ gRPC code. It is already checked in with the repository, and this step is only necessary if your installed protoc version differs substantially from the version used to previously generate the code.

    protoc -I ../.. --grpc_out=. --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ../../protos/*/v1/*.proto
    protoc -I ../.. --cpp_out=. ../../protos/*/v1/*.proto

    Build the example project.

    cmake .

    Running examples


    Refer to Formant's C++ example on github for more details

    1. Make sure Formant Agent is running. Refer to installing agent for more information. 

    systemctl status formant-agent | grep Active:

    2. Run each send example to ingest a test datapoint:


    3. Run the commands listener and then trigger a command from the app:


    4. Get and print the current custom configuration parameters


    5. Run an intervention request


    This will pause after sending the request in order for you to respond to it in the Formant app.

    © 2020 Formant • 1999 Bryant St · San Francisco, CA 94110