O'Reilly logo

Learning Microsoft Cognitive Services - Second Edition by Leif Larsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Speaking to the application

Add a new file to the Model folder, called SpeechToText.cs. Beneath the automatically created SpeechToText class, we want to add an enum type variable called SttStatus. It should have two values, Success and Error.

In addition, we want to define an EventArgs class for events that we will raise during execution. Add the following class at the bottom of the file:

    public class SpeechToTextEventArgs : EventArgs 
    { 
        public SttStatus Status { get; private set; } 
        public string Message { get; private set; } 
        public List<string> Results { get; private set; } 
 
        public SpeechToTextEventArgs(SttStatus status,  
        string message, List<string> results = null) 
        { 
            Status = status; 
            Message = message; 
            Results = results; 
        } 
    } 

As you can see, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required