Unlike the REST APIs, the client libraries utilize Websocket-based procotol. The client libraries are available on various platforms (Windows, Android, iOS) using different languages. Developers can download Microsoft Speech client libraries, and link into their apps. RequestStream.Write(buffer, 0, bytesRead) Ĭlient libraries: It is used for advanced features. ![]() While ((bytesRead = fs.Read(buffer, 0, buffer.Length)) != 0) Read 1024 raw bytes from the input audio file.īuffer = new Byte Using (Stream requestStream = request.GetRequestStream()) Open a request stream and write 1024 byte chunks in the stream one at a time. Using (fs = new FileStream(YOUR_AUDIO_FILE, FileMode.Open, FileAccess.Read)) Send an audio file by 1024 byte chunks Request.Headers = "YOUR_SUBSCRIPTION_KEY" Request.ContentType = codec=audio/pcm samplerate=16000" Request.ProtocolVersion = HttpVersion.Version11 Request = (HttpWebRequest)HttpWebRequest.Create(requestUri) Here is the simple example of header and C# code: HttpWebRequest request = null Rest API send a request to the Speech HTTP endpoints with the proper request header and body. It converts a short spoken audio (no longer than 15s), for example, commands without interim results. ![]() REST APIs: Developers can use HTTP calls from their apps to the service for speech recognition. It provides two ways for developers to add Speech to their apps: ![]() This API converts human speech to text that can be used as input or commands to control your application. The Microsoft Speech API supports both Speech to Text and Text to Speech conversion. Speech Service is an instrument which provides developers ability to create different speech-enabled features in their applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |