views:

530

answers:

3

There are two similar namespaces and assemblies for speech recognition in .NET. I’m trying to understand the differences and when it is appropriate to use one or the other.

There is System.Speech.Recognition from the assembly System.Speech (in System.Speech.dll). System.Speech.dll is a core DLL in the .NET Framework class library 3.0 and later

There is also Microsoft.Speech.Recognition from the assembly Microsoft.Speech (in microsoft.speech.dll). Microsoft.Speech.dll is part of the UCMA 2.0 SDK

I find the docs confusing and I have the following questions:

System.Speech.Recognition says it is for "The Windows Desktop Speech Technology", does this mean it cannot be used on a server OS or cannot be used for high scale applications?

The UCMA 2.0 Speech SDK ( http://msdn.microsoft.com/en-us/library/dd266409%28v=office.13%29.aspx ) says that it requires Microsoft Office Communications Server 2007 R2 as a prerequisite. However, I’ve been told at conferences and meetings that if I do not require OCS features like presence and workflow I can use the UCMA 2.0 Speech API without OCS. Is this true?

If I’m building a simple recognition app for a server application (say I wanted to automatically transcribe voice mails) and I don’t need features of OCS, what are the differences between the two APIs?

+7  A: 

The short answer is that Microsoft.Speech.Recognition uses the Server version of SAPI, while System.Speech.Recognition uses the Desktop version of SAPI.

The APIs are mostly the same, but the underlying engines are different. Typically, the Server engine is designed to accept telephone-quality audio for command & control applications; the Desktop engine is designed to accept higher-quality audio for both command & control and dictation applications.

You can use System.Speech.Recognition on a server OS, but it's not designed to scale nearly as well as Microsoft.Speech.Recognition.

The differences are that the Server engine won't need training, and will work with lower-quality audio, but will have a lower recognition quality than the Desktop engine.

Eric Brown
+3  A: 

I found Eric’s answer really helpful, I just wanted to add some more details that I found.

System.Speech.Recognition can be used to program the desktop recognizers. SAPI and Desktop recognizers have shipped in the products:

  • Windows XP: SAPI v5.1 and no recognizer
  • Windows XP Tablet Edition: SAPI v5.1 and Recognizer v6.1
  • Windows Vista: SAPI v5.3 and Recognizer v8.0
  • Windows 7: SAPI v5.4 and Recognizer v8.0?

Servers come with SAPI, but no recognizer:

  • Windows Server 2003: SAPI v5.1 and no recognizer
  • Windows Server 2008 and 2008 R2: SAPI v5.3? and no recognizer

Desktop recognizers have also shipped in products like office.

  • Microsoft Office 2003: Recognizer v6.1

Microsoft.Speech.Recognition can be used to program the server recognizers. Server recognizers have shipped in the products:

  • Speech Server (various versions)
  • Office Communications Server (OCS) (various versions)
  • UCMA – which is a managed API for OCS that (I believe) included a redistributable recognizer
  • Microsoft Server Speech Platform – recognizer v10.1

Desktop recognizers are designed to run inproc or shared. Shared recognizers are useful on the desktop where voice commands are used to control any open applications. Server recognizers can only run inproc. Inproc recognizers are used when a single application uses the recognizer or when wav files or audio streams need to be recognized (shared recognizers can’t process audio files, just audio from input devices).

You can use use the APIs to query determine your installed recongizers

  • Desktop: System.Speech.Recognition.SpeechRecognitionEngine.InstalledRecognizers()
  • Server: Microsoft.Speech.Recognition.SpeechRecognitionEngine.InstalledRecognizers()

I found that I can also see what recognizers are installed by looking at the registry keys:

  • Desktop recognizers: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Recognizers\Tokens
  • Server recognizers: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech Server\v10.0\Recognizers\Tokens
Michael Levy
If I read the docs correctly, only Desktop speech recognizers include the dictation grammar (system provided grammar used for free text dictation). The class System.Speech.Recognition.DictationGrammar has no complement in the Microsoft.Speech namespace.
Michael Levy
A: 

Since I can't add comments yet, I wanted to say thank you Michael. I have been looking for information on this for a while now.

Here is the link for the Speech Library (MS Server Speech Platform):

Microsoft Server Speech Platform 10.1 Released (SR and TTS in 26 languages)

Switch Commerce
10.2 was released recently too. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=bb0f72cb-b86b-46d1-bf06-665895a313c7
Michael Levy
Thanks for the info. I see that now includes a grammar validator. I was breaking my head trying to find errors in the ones I'm creating. Where should I keep watching for news about future releases?
Switch Commerce
"Where should I keep watching for news about future releases?" is a great question!!! http://www.microsoft.com/speech/developers.aspx is out of date. The speech blogs like http://blogs.msdn.com/b/speak/ and http://blogs.msdn.com/b/speech/ don't always have the latest updates. You might try http://gotspeech.net/ or the related sites like http://gotuc.net/. But as you can see, I haven't found a great source to keep up to date either.
Michael Levy