How do I select a Recognizer and Text-to-Speech Voice?

Last reviewed: 11/15/2001

Article ID: H110101

The information in this article applies to:

  • SpeechKit 3

Summary

SpeechKit 3 offers several ways for your application to select a recognizer and text-to-speech voice. You can change them by

  • setting the Engine or EngineID property value,
  • selecting from the dropdown combobox on the SpeechKit Console, or
  • selecting from the list displayed in the SelectEngine dialog.

More Information

To change the recognizer, set the ChantSR Engine or EngineID property to the desired value. For example, the default Engine property value if SAPI5 is installed is Microsoft English Recognizer v5.1. The EngineID for this recognizer is MSASREnglish.

To find out what recognizers and synthesizers are available on your system, you can display the SpeechKit Console. To display the console, set the Console property value to ConsoleDefault for both components (e.g., ChantSR1.Console = ConsoleDefault, ChantTTS1.Console = ConsoleDefault).

SpeechKit 3 Professional Edition provides additional methods for you to enumerate the available recognizers and synthesizers. The GetEngines method returns arrays of Engine and EngineID property values. You can present this information to your end user for them to select if appropriate. To select an engine, all you have to do is set either the Engine or EngineID property value. The SpeechKit component handles the rest. Even if you have active vocabularies, the component will automatically unload and reload the vocabularies under the new recognizer.

SpeechKit 3 Professional Edition also provides the SelectEngine dialog that displays a dialog from which to select the desired engine. When invoked from the ChantSR component, it displays recognizers. When invoked from the ChantTTS component, it displays synthesizers (i.e., voices).

Whenever you change the recognizer or voice, you are assoicating that selection with the Recognizer and Synthesizer component properties respectively. This allows you to adjust engine settings and persist those settings across application invocations. Therefore, you can also change the recognizer and voice at any time by setting these either the Recognizer or Synthesizer property values. If you change either of these property new values where information does not exist for them, then the current engine selection is associated with them. For example, assume your the following ChantTTS property settings:


    Synthesizer = "MicrosoftMikeSAPI5" Engine = "Microsoft Mike"

If your code invoke set the Synthesizer property to "NewVoice", then NewVoice would inherit all the same property settings as MicrosoftMikeSAPI5.

To associate your engine property settings, all you have to do is set the component properties. For example,


    Set ChantTTS1 = New ChantTTS // Allocate component
    ChantTTS1.Synthesizer = "FastTalkingMary"
    ChantTTS1.Engine = "Microsoft Mary"
    ChantTTS1.SetSpeed(5) Set ChantTTS1 = Nothing
    // Free component to save settings

    Set ChantTTS1 = New ChantTTS // Allocate component
    ChantTTS1.Synthesizer = "SlowTalkingSam"
    ChantTTS1.Engine = "Microsoft Sam"
    ChantTTS1.SetSpeed(-5)
    Set ChantTTS1 = Nothing
    // Free component to save settings

You can associate your engine using the SelectEngine dialog as follows:


    ChantTTS1.Synthesizer = "UserSelectedVoice1" ChantTTS1.SelectEngine("UserSelectedVoice1",hWnd)

Note that you do not have to set the Synthesizer (or Recognizer) property before invoking SelectEngine. We illustrate it here assuming you want this as the currently selected voice.

You will find all Application Framework property settings saved in the system registry under HKEY_CURRENT_USER\Software\Chant. To view these settings, click the Start button and select Run. Enter regedit in the text field and click the OK button.