Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
SrgsDocument Constructor (String)
Initializes a new instance of the SrgsDocument class specifying the location of the XML document that is used to fill in the SrgsDocument instance.
Namespace: Microsoft.Speech.Recognition.SrgsGrammar
Assembly: Microsoft.Speech (in Microsoft.Speech.dll)
Syntax
'Declaration
Public Sub New ( _
path As String _
)
'Usage
Dim path As String
Dim instance As New SrgsDocument(path)
public SrgsDocument(
string path
)
Parameters
- path
Type: System.String
The location of the SRGS XML file.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | path is a null reference (Nothing in Visual Basic). |
ArgumentException | path is an empty string. |
Examples
The following example creates a new SrgsDocument from the file named "srgsDocumentFile.xml".
string srgsDocumentFile = Path.Combine(Path.GetTempPath(), "srgsDocumentFile.xml");
SrgsDocument document = null;
if (File.Exists(srgsDocumentFile))
document = new SrgsDocument(srgsDocumentFile);