Last reviewed: 12/15/2024 8:23:12 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 KinesicsKit with Windows Desktop (WinUI) applications.

KinesicsKit Assemblies

KinesicsKit 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 access KinesicsKit .NET classes within a Windows Desktop (WinUI) application, add project references with the following nuget package:

  • 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.KinesicsKit.Windows package and press the Install button.
  • Chant KinesicsKit Windows package

To access the KinesicsKit .NET classes within your application, add references to the Chant shared and KinesicsKit assemblies in your code.


using System;
...
using Chant.KinesicsKit.Windows;
using Chant.Shared.Windows;

Object Instantiation

Declare variables for the KinesicsKit classes, instantiate instance, add the event handlers, and set the credentials.


private NKinesicsKit _KinesicsKit;
private NChantKinectSensor _Sensor;
public MainWindow()
{
    InitializeComponent();
    // Instantiate KinesicsKit object
    _KinesicsKit = new NKinesicsKit();
    if (_KinesicsKit != null)
    {
        // Set credentials
        _KinesicsKit.SetCredentials("Credentials");
        // Create KinectSensor
        _Sensor = _KinesicsKit.CreateKinectSensor();
        if (_Sensor != null)
        {
            // Setup event callback handler
            _Sensor.MultiSourceFrameArrived += this.NKinectSensor_MultiSourceFrameArrived;
        }
    }
}

Event Callbacks

Event callbacks are the mechanism in which the class object sends information back to the application such as image capture, movement detection, or there was an error.


private void NKinectSensor_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
{
    MultiSourceFrameReference multiSourceFrameReference = e.FrameReference;
    if (multiSourceFrameReference != null)
    {
        MultiSourceFrame multiSourceFrame = multiSourceFrameReference.AcquireFrame();
        if (multiSourceFrame != null)
        {
            ...
            multiSourceFrame.Dispose();
        }
        multiSourceFrameReference.Dispose();
    }
}

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

  1. Select the Build tab under project properties.
  2. Select x86 or x64 in the Platform target dropdown list.

These applications require the applicable KinesicsKit Kinect API library in the same directory (AppX) as the application .exe.

Speech API KinesicsKit Speech API class KinesicsKit Speech API library
Microsoft Kinect 2.0NKinectSensorCKinesicsKit.Kinect.dll or CKinesicsKitX64.Kinect.dll

Development and Deployment Checklist

When developing and deploying Windows Desktop (WinUI) 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 require the applicable KinesicsKit Speech API library:

  • Develop and deploy Windows Desktop (WinUI) applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy Chant.KinesicsKit.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 CKinesicsKit.Kinect.dll to the target system.
  • Copy NKinesicsKit.dll to the target system,
    • register as a COM library on the target system, or
    • place in the same directory with Windows Desktop (WinUI) application and include an App.manifest with a dependent assembly declaration:
      
      <dependency>
          <dependentAssembly>
                  <assemblyIdentity type="win32" name="Chant.KinesicsKit.Windows" version="9.0.0.0" publicKeyToken="14b829eb51f0f386" />
          </dependentAssembly>
      </dependency>
  • Develop and deploy Windows Desktop (WinUI) applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
  • Copy Chant.KinesicsKit.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 CKinesicsKitX64.Kinect.dll to the target system.
  • Copy NKinesicsKitX64.dll to the target system,
    • register as a COM library on the target system, or
    • place in the same directory with Windows Desktop (WinUI) application and include an App.manifest with a dependent assembly declaration:
      
      <dependency>
          <dependentAssembly>
                  <assemblyIdentity type="win32" name="Chant.KinesicsKit.Windows" version="9.0.0.0" publicKeyToken="14b829eb51f0f386" />
          </dependentAssembly>
      </dependency>

Sample Projects

Windows Desktop (WinUI) sample projects are installed at the following location:

  • Documents\Chant\KinesicsKit 9\WinUI\Windows\cs.