Last reviewed: 7/27/2024 10:39:05 AM

Microsoft Visual C++ Applications

Develop C++ applications that manage voice markup using your favorite version of Microsoft Visual C++.

The following sections describe the steps for integrating VoiceMarkupKit with Microsoft Visual C++ applications.

VoiceMarkupKit Header Files

VoiceMarkupKit includes C++ header files comprised of the C++ classes that manage grammars and automatically load and unload the runtime DLL.

To access VoiceMarkupKit C++ classes within a Visual C++ application, add project references to the following nuget packages:

  • Select the application project in the Solution Explorer.
  • Right-click the mouse and select the Manage Nuget Packages… menu item.
  • Enter Chant in the search bar.
  • Select the Chant.VoiceMarkupKit.Windows package and press the Install button.
  • Chant VoiceMarkupKit Windows package
  • Select the Chant.Shared.Windows package and press the Install button.
  • Chant Shared Windows package

To access the VoiceMarkupKit C++ classes within your application, add a reference to the Chant shared and VoiceMarkupKit header files in your C++ application header file:


#include "Chant.Shared.Windows.h"
#include "Chant.VoiceMarkupKit.Windows.h"

Add a reference in your C++ application source file to the Chant shared and VoiceMarkupKit code needed to dynamically load and unload the runtime DLL:


#include "Chant.Shared.Windows.cpp"
#include "Chant.VoiceMarkupKit.Windows.cpp"

Object Instantiation

Declare a global variable for the VoiceMarkupKit class, instantiate instance, set the credentials, and set the event handler message.

Add the following to your application header file:


    protected:
    CVoiceMarkupKit* _VoiceMarkupKit;
    CAcaTTSVoiceMarkup* _AcaTTSVoiceMarkup;
    CCereVoiceVoiceMarkup* _CereVoiceVoiceMarkup;
    CSAPI5VoiceMarkup* _SAPI5VoiceMarkup;
    CW3CSSMLVoiceMarkup* _W3CSSMLVoiceMarkup;

Add the following to your application source file:


// Instantiate VoiceMarkupKit object
_VoiceMarkupKit = new CVoiceMarkupKit();
if (_VoiceMarkupKit != NULL)
{
    // Set credentials
    _VoiceMarkupKit->SetCredentials(L"Credentials");
    // Create VoiceMarkups
    _AcaTTSVoiceMarkup = _VoiceMarkupKit->CreateAcaTTSVoiceMarkup();
    _CereVoiceVoiceMarkup = _VoiceMarkupKit->CreateCereVoiceVoiceMarkup();
    _SAPI5VoiceMarkup = _VoiceMarkupKit->CreateSAPI5VoiceMarkup();
    _W3CSSMLVoiceMarkup = _VoiceMarkupKit->CreateW3CSSMLVoiceMarkup();
}

Event Callbacks

There are no event callbacks in VoiceMarkupKit.

Development and Deployment Checklist

When developing and deploying C++ applications, ensure you have a valid license, bundle the correct Chant class library, and configure your installation properly on the target system. Review the following checklist before developing and deploying your applications:

  • Develop and deploy C++ applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy CVoiceMarkupKit.dll to the target system and place in the same directory with your application.
  • Develop and deploy C++ applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy CVoiceMarkupKitX64.dll to the target system and place in the same directory with your application.

Sample Projects

Microsoft Visual C++ sample projects that use nuget packages may be found in the following directory of the vssamples.zip download:

  • Chant\VoiceMarkupKit 10\CDLL.