How Tos

Last reviewed: 7/15/2015

Article ID: H071502

HOW: Using collection classes to enumerate speech objects

The information in this article applies to:

  • GrammarKit 5
  • KinesicsKit 3
  • LexiconKit 5
  • ProfileKit 5
  • SpeechKit 8
  • VoiceMarkupKit 5
  • VoiceXMLKit 2

Summary

Use for and foreach syntax to enumerate recognizers, synthesizers, profiles, recognized phrases, and other collections.

More Information

The following new collection classes are available for easy enumeration:

  • AudioBeamSubFrameCollection
  • AudioBodyCorrelationCollection
  • ChantAlternateCollection
  • ChantAlternateWordCollection
  • ChantAudioCaptureDeviceCollection
  • ChantAudioInDeviceCollection
  • ChantAudioMixerCollection
  • ChantAudioMixerLineCollection
  • ChantAudioOutDeviceCollection
  • ChantAudioRenderDeviceCollection
  • ChantDictationSourceCollection
  • ChantDictationTopicCollection
  • ChantLexiconShortcutCollection
  • ChantLexiconWordPronunciationCollection
  • ChantPhrasePropertyCollection
  • ChantRuleCollection
  • ChantSpeakerCollection
  • ChantSpeakerPropertyCollection
  • ChantSREngineCollection
  • ChantTTSEngineCollection
  • ChantWordAlternateCollection
  • ChantWordCollection
  • JointOrientationCollection

The following example illustrates enumerating speech engines and accessing their properties.

private Chant.SpeechKit.NChantTTS NChantTTS1;
foreach (NChantTTSEngine chantTTSEngine in NChantTTS1.ChantTTSEngines)
{
// Access engine properties
string engine = chantTTSEngine.Engine;
}