The Azure Code Samples are currently available in English
Samples for Microsoft C# speech client library
September 2018: New Microsoft Cognitive Services Speech SDK available
Please check out Microsoft Cognitive Services Speech SDK for documentation, links to the download pages, and the samples.
This repository contains samples for transcribing speech to text using Microsoft Speech Service, an offering within Microsoft Cognitive Services, formerly known as Project Oxford.
The C# client library
The C# client library is provided as Nuget packages. There are two NuGet packages available at nuget.org.
- Microsoft.ProjectOxford.SpeechRecognition-x86 for x86 build.
- Microsoft.ProjectOxford.SpeechRecognition-x64 for x64 build.
This sample is a Windows WPF application to demonstrate the use of Speech-to-Text with Microsoft 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
- Start Microsoft Visual Studio 2015 and select File > Open > Project/Solution.
- Navigate to the folder where you cloned the repository.
- Double-click the Visual Studio 2015 Solution file
- There are 2 projects in the solution. One is for the x86 platform, and the other is for the x64 platform. Choose the build platform (x86 or x64) and configuration (Debug or Release) of your preference, and build the project.
- For intent recognition to work, you need to sign up to the Language Understanding Intelligent Service (LUIS). Please put the endpoint URL of your LUIS app in
app.configfile in the
samples/SpeechRecognitionServiceExamplefolder. For more infomraiton on the endpoint URL of LUIS app, see Publish LUIS App. You must replace the character
&in the LUIS endpoint URL with
&to ensure that the URL is correctly interpreted by the XML parser.
Run the sample
Before running the sample, you must first have a subscription key. You can get free trial subscription keys from the Cognitive Services Subscription page. After you select the Speech API, click Get API Key to get the key. It returns a primary and secondary key. Both keys are tied to the same quota, so you may use either key.
Paste your subscription key to the text edit box saying "Paste your subscription key here to start" on the top right corner. 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 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 this repository and we'll address them as we can. Learn more about how you can help on our Contribution Rules & Guidelines.
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 and sample, are expected to follow the "Developer Code of Conduct for Microsoft Cognitive Services", found at http://go.microsoft.com/fwlink/?LinkId=698895.