Last reviewed: 3/23/2024 10:41:24 AM

Java Applications

Develop Java applications that manage voice markup using your favorite Java development tools. This includes development environments such as Eclipse, IntelliJ, JDeveloper, and NetBeans.

The following sections describe the steps for integrating VoiceMarkupKit with Java applications.

JRE Configuration

VoiceMarkupKit includes Java libraries for JDK 1.8, 11, 17, and 21 to support most applications' target runtime environments. If you need a specific target runtime, then contact Chant Product Support.

To access the VoiceMarkupKit Java classes within your application, add the class libraries to your JDK environment:

  1. copy the JVoiceMarkupKit.DLL file to your Java JDK bin directory;
  2. copy the voicemarkupkit.jar and chant.shared.jar libraries to your Java JDK lib; and
  3. append a path reference for your Java JDK lib\voicemarkupkit.jar and lib\chant.shared.jar paths as a classpath property in your system settings.
  1. copy the JVoiceMarkupKitX64.DLL file to your Java JDK bin directory;
  2. copy the voicemarkupkit.jar and chant.shared.jar class libraries to your Java JDK lib; and
  3. append a path reference for your Java JDK lib\voicemarkupkit.jar and lib\chant.shared.jar paths as a classpath property in your system settings.

To access the VoiceMarkupKit Java classes within your application, add references to the Chant shared and VoiceMarkupKit class libraries in your code:


import com.voicemarkupkit.*;
import net.chant.shared.*;

Object Instantiation

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


public class Frame1 extends JFrame
{
    private JVoiceMarkupKit _VoiceMarkupKit;
    private JAcaTTSVoiceMarkup _AcaTTSVoiceMarkup = null;
    private JCereVoiceVoiceMarkup _CereVoiceVoiceMarkup = null;
    private JSAPI5VoiceMarkup _SAPI5VoiceMarkup = null;
    private JW3CSSMLVoiceMarkup _W3CSSMLVoiceMarkup = null;
    private void jInit() throws Exception
    {
        // Create VoiceMarkupKit object
        _VoiceMarkupKit = new JVoiceMarkupKit();
        if (_VoiceMarkupKit != null)
        {
            // Set credentials
            _VoiceMarkupKit.setCredentials("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 Java applications, ensure you have a valid license, bundle the correct Chant class libraries, and configure your installation properly on the target system. Review the following checklist before developing and deploying your applications:

  • Develop and deploy Java applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy voicemarkupkit.jar and chant.shared.jar to the target system Java JRE lib directory and/or ensure the classpath includes the path where the voicemarkupkit.jar and chant.shared.jar libraries are placed on your target system.
  • Copy JVoiceMarkupKit.dll to the target system Java JRE bin directory.
  • Develop and deploy Java applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy voicemarkupkit.jar and chant.shared.jar to the target system Java JRE lib directory and/or ensure the classpath includes the path where the voicemarkupkit.jar and chant.shared.jar libraries are placed on your target system.
  • Copy JVoiceMarkupKitX64.dll to the target system.

Sample Projects

Java sample projects are installed at the following location:

  • Documents\Chant\VoiceMarkupKit 10\Java.