How do I determine when to use managed SAPI or COM SAPI with CDW 2014 applications?

Last reviewed: 9/1/2014

HOW Article ID: H091401

The information in this article applies to:

  • GrammarKit 5
  • SpeechKit 8
  • VoiceMarkupKit 5

Summary

.NET applications can access SAPI recognizers and synthesizers via managed SAPI or COM SAPI APIs. The APIs are different and managed SAPI offers only a subset of the full COM SAPI capabilities.

GrammarKit 5, SpeechKit 8, and VoiceMarkupKit 5 include .NET classes that provide a common interface for applications to use either managed SAPI libraries: System.Speech and Microsoft.Speech or the full COM SAPI.

Managed SAPI limits applications to SAPI-only speech technology and other .NET managed SAPI limitations. However, it does eliminate the need to deploy the Chant interop COM library that interfaces with COM SAPI and other speech APIs.

The best way to determine which SAPI is best for an application is to review which features are available that address application requirements.

More Information

The following table identifies the differences between managed SAPI and COM SAPI to determine which is best on the basis of application requirements.

FeatureManaged SAPICOM SAPI
Audio ManagementNone. Uses default audio devices.Allows application to set specific audio devices for recognition and synthesis playback.
Grammar SyntaxW3C XMLSAPI 5 XML and W3C XML
Profile ManagementSpeaker settings are adjusted via control panel.Allows application to enumerate, set, and update speaker profile and properties.
PhonemesMicrosoft Universal Phone Set (UPS)IPA
Rule ManagementNone since there is no SAPI XML grammar support.Allows application to enumerate, enable, and disable SAPI 5 XML grammar rules.
TTS MarkupW3C SSMLSAPI 5 SSML and W3C SSML
User InterfaceAudio Setup, Microphone, and Speaker Training dialogs launch via control panel.Allows application to launch dialogs.
Word CorrectionNone.Allows application to commit alternate recognition results.

The NChant classes in the new managed SAPI assemblies are the same as their COM SAPI counterparts.

Chant ProductChant Managed SAPI AssemblyChant COM SAPI Assembly
AllChant.Shared.Managed.dllChant.Shared.dll
GrammarKitChant.GrammarKit.Managed.dllChant.GrammarKit.dll
SpeechKitChant.SpeechKit.Managed.dllChant.SpeechKit.dll
VoiceMarkupKitChant.VoiceMarkupKit.Managed.dllChant.VoiceMarkupKit.dll

There are new Chant Developer Workbench application view assemblies that use the new managed SAPI assemblies. The file name is the same as their COM SAPI counterparts so they are installed in the product NET\libv4 folder. To design and test managed SAPI grammars and text-to-speech markup, copy the managed SAPI framework libraries to the Developer Workbench runtime folder.

  • Rename:
    • C:\Program Files\Chant\GrammarKit 5\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.GrammarKit.dll to Chant.Developer Workbench.ApplicationView.GrammarKit.bak,
    • C:\Program Files\Chant\SpeechKit 8\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.SpeechKit.dll to Chant.Developer Workbench.ApplicationView.SpeechKit.bak, and
    • C:\Program Files\Chant\VoiceMarkupKit 5\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.dll to Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.bak.
  • Copy:
    • C:\Program Files\Chant\GrammarKit 5\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.GrammarKit.dll,
    • C:\Program Files\Chant\SpeechKit 8\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.SpeechKit.dll, and
    • C:\Program Files\Chant\VoiceMarkupKit 5\Win32\NET\libv4\Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.dll
    to C:\Program Files\Chant\Developer Workbench 2014\Win32.
  • Rename:
    • C:\Program Files\Chant\GrammarKit 5\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.GrammarKit.dll to Chant.Developer Workbench.ApplicationView.GrammarKit.bak,
    • C:\Program Files\Chant\SpeechKit 8\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.SpeechKit.dll to Chant.Developer Workbench.ApplicationView.SpeechKit.bak, and
    • C:\Program Files\Chant\VoiceMarkupKit 5\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.dll to Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.bak.
  • Copy:
    • C:\Program Files\Chant\GrammarKit 5\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.GrammarKit.dll,
    • C:\Program Files\Chant\SpeechKit 7\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.SpeechKit.dll, and
    • C:\Program Files\Chant\VoiceMarkupKit 8\Win64\NET\libv4\Chant.Developer Workbench.ApplicationView.VoiceMarkupKit.dll
    to C:\Program Files\Chant\Developer Workbench 2014\Win64.