In order to use the Speech API, you need to register it first. In this video, learn how this takes the Vision API project and slightly modifies it to target speech.
- Now before we dive into the guts of the Speech API when it comes to code let's go ahead and set up our project. Instead of repeating older instructions, what I'd like you to do is go into exercise files and look for the fifth folder in here. Take the end code from this fifth folder and go ahead and unzip that into a folder. I have chosen to unzip this in a folder called speechAPI. Once you unzip the folder you should see a file structure that looks like this.
Go ahead and run npm install. And once you have done an npm install you should see a folder called loadmodules. Of course if you're following this course in C# or in any other platform, then the instructions would be different. But essentially what we need is a way to be able to call the rest service and be able to read a file. Next, I'd like you to go ahead and open this project in VS Code. In this consol.log that we have in here go ahead and remove it and introduce this readBytes method that we had written in the previous chapter.
As you're well aware, this readBytes method, the responsibility of this method is to read a file that you specify as filePath, and return that as a buffer. So in order for this method to work, I also need to add some supporting import statements. So, import star as fs from fs and import buffer from buffer. Excellent.
Also go into the config.ts and go ahead and clear out the keys that you see in here. Those keys were specific to the Vision API. We are going to need different keys and a different endpoint for this Speech API. At this point, you're ready to write this code. I'll be referencing to this project later as well.
- Exploring the possibilities of the Vision API
- Submitting an image to the Vision API for processing
- Asking the Vision API to recognize faces
- Working with the Speech API
- Writing speech-to-text code
- Working with the Language API
- Getting languages for translation
- Language Understanding (LUIS) concepts