Skip to main content
Skip table of contents

How-to: Download, Compile & Run C++ Samples

Install Conan

Please follow our guide How-to: Install & Configure Conan.

Install CMake

This is our build system, version 3.16 or higher is needed. You can either get it via your Linux package manager or the official installer (don’t forget to add the binary to PATH if needed!)

Download

Samples are available through Conan. Here is the list of available samples:

Package name

Description

simple-application

Demonstrate the use of Speech Synthesis right after Voice Recognition.

dynamic-grammar

Demonstrate the use of dynamic models (i.e. using slots inside grammars and filling them at runtime).

chained-grammars

Demonstrate how to do a gap-less Voice Recognition between a Wake-up Word and another model.

tts

Demonstrate how to use Speech Synthesis.

voice-biometrics

Demonstrate how to use Voice Biometrics.

voice-commands-language-understanding

Demonstrate how to use the Natural Language Understanding technology alongside voice recognition

speech-enhancement

Demonstrate how to use the Speech Enhancement technology coupled with two speech recognition, one with the speech enhancement and the other without so they can be compared

Sample availability depends on your contract. To determine if you have access to it, do this:

BASH
conan search -r vivoka-customer <sample-name>

A list of package reference will appear if you have access, always select the latest version.

First you’ll have to check the required options:

CODE
conan inspect -r vivoka-customer -a options <sample-name>/<version>@vivoka/customer

Select the engines you want (you need to have access to them too, check your contract!) like so:

BASH
cd vdk-samples
# Example using the CSDK TTS engine
conan install -if <sample-name> <sample-name>/<version>@vivoka/customer -o tts_engine=csdk

If the download fails with an error saying a package cannot be found, it means you don’t have access to the related engine(s). If you are sure your contract includes this technology SDK nonetheless, please open a support ticket and we will correct that as soon as possible.

Compilation

Each sample features a README.md file that explains how to build it along with its options. But generally speaking, there are two big steps:

BASH
# Check the options
conan inspect . -a options

# First install the dependencies and configure options for this build (do it once)
conan install . -if build -o opt1=value1 -o opt2=value2

# Build the program
conan build . -if build

To check the possible options and their values, run the command . Most sample will require you to select a SDK for the engines you want to use.

If you want to build your project in Debug, when installing, you need to set the build_type only for your project to debug:

CODE
conan install -if build/Debug . -s<YOUR_CONAN_PROJECT_NAME>:build_type=Debug

Running the sample

Linux
BASH
./build/<executable>
Windows
BASH
cmd /c "build\generators\conanrun.bat && build\Release\<executable>.exe"

Use //c if writing this command from Git Bash!

The conanrun.bat script is only needed when starting the program from the build tree, its purpose is to add the dependencies' DLL to the PATH before attempting to run the program.

When deploying your executable to a device, bring all the required DLLs next to the executable.

Troubleshooting

Conan can’t build the SDK but my profile is correct, why?

Dependencies whose name ends with @vivoka/customer cannot be built on your machine as we only give you the resulting libraries or executables. If Conan tries to build one of our packages, it means there is a configuration mismatch that needs to be corrected. Please check that:

  • Your profile is in Release mode (e.g. conan profile get settings.build_type <profile_name> returns Release)

  • You have run the command to enable the revision mode (see the Conan setup guide)

Conan can’t install asound library

You need to add the following content to the file ~/.conan/global.conf:

BASH
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.