Compile Method (String, Stream)

Microsoft Speech Platform SDK 11

Collapse image Expand Image Copy image CopyHover image

Compiles an XML-format grammar file into a binary grammar file with the .cfg extension and sends the output to a stream.

Namespace:  Microsoft.Speech.Recognition.SrgsGrammar
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

Syntax

Visual Basic (Declaration)
Public Shared Sub Compile ( _
	inputPath As String, _
	outputStream As Stream _
)
Visual Basic (Usage)
Dim inputPath As String
Dim outputStream As Stream

SrgsGrammarCompiler.Compile(inputPath, outputStream)
C#
public static void Compile(
	string inputPath,
	Stream outputStream
)

Parameters

inputPath
Type: System..::..String

The path of the file to compile.

outputStream
Type: System.IO..::..Stream

The stream that receives the results of compilation.

Exceptions

ExceptionCondition
ArgumentNullException

inputPath is nullNothingnullptrunita null reference (Nothing in Visual Basic).

outputStream is nullNothingnullptrunita null reference (Nothing in Visual Basic).

ArgumentException

inputPath is an empty string.

Remarks

The XML-format grammar file must conform to the Speech Recognition Grammar Specification (SRGS) Version 1.0.

When accessing files, a security check is performed when the file is created or opened. The security check is typically not done again unless the file is closed and reopened.

For more information, see Compile SRGS Grammars (Microsoft.Speech).

See Also