Last reviewed: 3/23/2024 10:38:46 AM
Delphi VCL and FireMonkey Applications
Develop Object Pascal applications that manage voice markup using your favorite version of Delphi.
The following sections describe the steps for integrating VoiceMarkupKit with Delphi VCL and FireMonkey applications.
VoiceMarkupKit Unit
VoiceMarkupKit includes an Object Pascal source file Chant.VoiceMarkupKit.pas comprised of the Object Pascal classes that manage grammars. It also includes an Object Pascal source file Chant.Shared.pas comprised of common Object Pascal classes that all Chant libraries use.
To access the VoiceMarkupKit Object Pascal classes within your application, first add a project reference to the VoiceMarkupKit Object Pascal source files:
- Within your Delphi project, select Project Options.
- Select the Delphi compiler options.
- Add Search path reference to the VoiceMarkupKit unit source file directory: C:\Program Files\Chant\VoiceMarkupKit 10\Delphi\source.
- Add unit output path reference to the local directory with a period '.' character.
To access the VoiceMarkupKit Object Pascal classes within your application, add a reference to the Chant.Shared and Chant.VoiceMarkupKit units in your uses clause.
unit Unit1;
interface
uses
..., Chant.Shared, Chant.VoiceMarkupKit;
Add an event handler declaration and Object instance variable to the application declarations.
type
TForm1 = class(TForm)
...
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
_VoiceMarkupKit: TVoiceMarkupKit;
_AcaTTSVoiceMarkup: TAcaTTSVoiceMarkup;
_CereVoiceVoiceMarkup: TCereVoiceVoiceMarkup;
_SAPI5VoiceMarkup: TSAPI5VoiceMarkup;
_W3CSSMLVoiceMarkup: TW3CSSMLVoiceMarkup;
Object Instantiation
Instantiate an instance, set the credentials, and set the event handler message.
// Instantiate VoiceMarkupKit object
_VoiceMarkupKit := TVoiceMarkupKit.Create();
if (_VoiceMarkupKit <> nil) then
begin
// Set credentials
_VoiceMarkupKit.SetCredentials('Credentials');
// Create VoiceMarkups
_AcaTTSVoiceMarkup := _VoiceMarkupKit.CreateAcaTTSVoiceMarkup();
_CereVoiceVoiceMarkup := _VoiceMarkupKit.CreateCereVoiceVoiceMarkup();
_SAPI5VoiceMarkup := _VoiceMarkupKit.CreateSAPI5VoiceMarkup();
_W3CSSMLVoiceMarkup := _VoiceMarkupKit.CreateW3CSSMLVoiceMarkup();
end;
Event Callbacks
There are no event callbacks in VoiceMarkupKit.
Development and Deployment Checklist
When developing and deploying Delphi VCL and FireMonkey 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 Delphi VCL and FireMonkey 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 Delphi VCL and FireMonkey 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
Delphi VCL and FireMonkey sample projects are installed at the following location:
- Documents\Chant\VoiceMarkupKit 10\Delphi.