Last reviewed: 12/15/2024 8:45:25 AM
Windows Desktop (WinUI) Applications
Develop Windows Desktop (WinUI) applications that speak and listen using your favorite Windows App SDK development tools. This includes development environments such as Microsoft Visual Studio.
The following sections describe the steps for integrating VoiceMarkupKit with Windows Desktop (WinUI) applications.
VoiceMarkupKit Assemblies
VoiceMarkupKit includes Windows App SDK compatible .NET assemblies to support most applications' target framework. If you need a specific target framework, then contact Chant Product Support.
To generate markup within a WPF application, add project references with the applicable nuget package depending on the application type and desired speech APIs:
- 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.
-
For W3C SSML:
- Select the Chant.VoiceMarkupKit package and press the Install button.
-
For Acapela Tag, Azure SSML, CereVoice, Microsoft SAPI5 XML, and W3C SSML:
- Select the Chant.VoiceMarkupKit.Windows package and press the Install button.
To access the VoiceMarkupKit .NET classes within applications that generate W3C SSML, add references to the Chant shared and VoiceMarkupKit assemblies in your code.
using System;
...
using Chant.VoiceMarkupKit;
using Chant.Shared;
To access the VoiceMarkupKit .NET classes within applications that generate Acapela Tag, Azure SSML, CereVoice, Microsoft SAPI5 XML, and W3C SSML, add references to the Chant shared and VoiceMarkupKit assemblies in your code.
using System;
...
using Chant.VoiceMarkupKit.Windows;
using Chant.Shared.Windows;
Object Instantiation
Declare a global variable for the VoiceMarkupKit class, instantiate an instance, add the event handler, and set the credentials.
private NVoiceMarkupKit _VoiceMarkupKit = null;
private NAcaTTSVoiceMarkup _AcaTTSVoiceMarkup = null;
private NCereVoiceVoiceMarkup _CereVoiceVoiceMarkup = null;
private NSAPI5VoiceMarkup _SAPI5VoiceMarkup = null;
private NW3CSSMLVoiceMarkup _W3CSSMLVoiceMarkup = null;
public MainWindow()
{
InitializeComponent();
// Instantiate VoiceMarkupKit object
_VoiceMarkupKit = new NVoiceMarkupKit();
if (_VoiceMarkupKit != null)
{
// Set credentials
_VoiceMarkupKit.SetCredentials("Credentials");
// Create VoiceMarkups
_AcaTTSVoiceMarkup = _VoiceMarkupKit.CreateAcaTTSVoiceMarkup();
_CereVoiceVoiceMarkup = _VoiceMarkupKit.CreateCereVoiceVoiceMarkup();
_SAPI5VoiceMarkup = _VoiceMarkupKit.CreateSAPI5VoiceMarkup();
_W3CSSMLVoiceMarkup = _VoiceMarkupKit.CreateW3CVoiceMarkup();
}
}
Event Callbacks
There are no event callbacks in VoiceMarkupKit.
Platform Target
Set the project Platform target to either x86 for 32-bit application or x64 for 64-bit application as follows:
Within your C# project
- Select the Build tab under project properties.
- Select x86 or x64 in the Platform target dropdown list.
Development and Deployment Checklist
When developing and deploying .NET 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 applications that generate W3C SSML:
- Develop and deploy .NET applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy Chant.VoiceMarkupKit.dll and Chant.Shared.dll assemblies to the target system or merge them with your application using an obfuscator like .NET Reactor by Eziriz.
Review the following checklist before developing and deploying applications that generate Acapela Tag, Azure SSML, CereVoice, Microsoft SAPI5 XML, and W3C SSML:
- Develop and deploy .NET applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy Chant.VoiceMarkupKit.Windows.dll and Chant.Shared.Windows.dll assemblies to the target system or merge them with your application using an obfuscator like .NET Reactor by Eziriz.
-
Copy NVoiceMarkupKit.dll to the target system,
- register as a COM library on the target system, or
-
place in the same directory with .NET application and include an App.manifest with a dependent assembly declaration:
<dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Chant.VoiceMarkupKit.Windows" version="11.0.0.0" publicKeyToken="75ad107bb2bd35e7" /> </dependentAssembly> </dependency>
- Develop and deploy .NET applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy Chant.VoiceMarkupKit.Windows.dll and Chant.Shared.Windows.dll assemblies to the target system or merge them with your application using an obfuscator like .NET Reactor by Eziriz.
-
Copy NVoiceMarkupKitX64.dll to the target system,
- register as a COM library on the target system, or
-
place in the same directory with .NET application and include an App.manifest with a dependent assembly declaration:
<dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Chant.VoiceMarkupKit.Windows" version="11.0.0.0" publicKeyToken="75ad107bb2bd35e7" /> </dependentAssembly> </dependency>
Sample Projects
Windows desktop sample projects are installed at the following location:
- Documents\Chant\VoiceMarkupKit 11\WinUI\Windows\cs.