Microsoft Bing Speech API: Windows Speech-to-Text Sample

Senast uppdaterad: 2017-06-13
Redigera på GitHub

This repo contains the Windows client library & sample for using Speech-to-Text in the Microsoft Bing Speech API, an offering within Microsoft Cognitive Services, formerly known as Project Oxford. * Learn about the Bing Speech API * Read the documentation * Find more SDKs & Samples

The Client Library

The Speech-to-Text client library is a thin C# client wrapper for Bing Speech API.

The easiest way to use this client library is to get microsoft.projectoxford.speechrecognition package from nuget. There are two nuget packages. One is for x86 build, and one is for x64 build. * For x86 package, please go to Speech Recognition API x86 Package in nuget for more details. * For x64 package, please go to Speech Recognition API x64 Package in nuget for more details.

The Sample

This sample is a Windows WPF application to demonstrate the use of Speech-to-Text in the Bing Speech API. It demonstrates the following features using a wav file or external microphone input: * Short-form recognition * Long-form dictation * Recognition with intent

Build the sample

  1. Start Microsoft Visual Studio 2015 and select File > Open > Project/Solution.

  2. Navigate to the folder where you cloned the repository.

  3. Double-click the Visual Studio 2015 Solution (.sln) file SpeechToText-WPF-Sample.

  4. Choose the build flavor to be x64. This is important because the sample is using Microsoft.ProjectOxford.SpeechRecognition-x64 nuget package by default.

  5. Press Ctrl+Shift+B, or select Build > Build Solution.

For intent recognition to work, you need to sign up Language Understanding Intelligent Service (LUIS). Please put your LUIS App ID and Subscription ID in app.config file. app.config file can be located from Solution Explorer.

Run the sample

After the build is complete, press F5 to run the sample.

First, you must obtain a Speech API subscription key by following the instructions on our website.

Locate the text edit box saying "Paste your subscription key here to start" on the top right corner. Paste your subscription key. You can choose to persist your subscription key in your machine by clicking "Save Key" button. When you want to delete the subscription key from the machine, click "Delete Key" to remove it from your machine.

Microsoft will receive the audio you upload and may use them to improve the Bing Speech API and related services. By submitting an audio, you confirm you have consent from everyone in it.


We welcome contributions. Feel free to file issues and pull requests on the repo and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below: - Support questions: StackOverflow - Feedback & feature requests: Cognitive Services UserVoice Forum

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.


All Microsoft Cognitive Services SDKs and samples are licensed with the MIT License. For more details, see LICENSE.

Sample images are licensed separately, please refer to LICENSE-IMAGE.

Developer Code of Conduct

Developers using Cognitive Services, including this client library & sample, are expected to follow the “Developer Code of Conduct for Microsoft Cognitive Services”, found at