AT&T API Platform SDK for Microsoft®  2.3.3
Wrapper classes that allow developers to build robust applications using .NET
 All Classes Namespaces Functions Enumerations Properties
Speech To Text Custom Service Cookbook

Overview

This cookbook shows you how to develop a Custom Speech Service application using the Platform SDK for Microsoft.
The Platform SDK for Microsoft provides the following methods:

  • SpeechToTextCustom

To use these methods in an application, perform the following steps:

  1. Add a reference to the SDK as shown in the About the Cookbooks section and import the ATT_MSSDK.Speechv3 namespace.
  2. Create an instance of RequestFactory with the scope type RequestFactory.ScopeTypes.STTC, as shown in the About the Cookbooks section.
  3. Invoke the Speech Service methods using the RequestFactory instance.

Converting Spoken Audio to Text

To convert the spoken audio to text, invoke the ATT_MSSDK.RequestFactory.SpeechToTextCustom method using the RequestFactory instance by passing an audio file location and the context to be applied for Speech to Text conversion along with optional dictionary and grammar file paths as shown in the following code example.

 // Path of the audio file to convert to text
 string fileToConvert = "xxxxxxxxx\\xxxxxxxx\\xxxxx"; 
 string xArgs = "xxxxxxxx"; // example ClientApp=Test
 string audioContentType = "xxxxxxx"; // example "audio/wav";
 SpeechResponse response = this.requestFactory.SpeechToTextCustom(fileToConvert, dictionaryFile, grammarFile, XSpeechContext.GenericHints);