Run your new console application to start speech recognition from a microphone: dotnet run
#SPEECH TO TEXT WINDOWS 10 HOW TO#
For details about how to identify one of multiple languages that might be spoken, see language identification. The default language is en-US if you don't specify a language. To change the speech recognition language, replace en-US with another supported language. See the Cognitive Services security article for more information.
For production, use a secure way of storing and accessing your credentials like Azure Key Vault. Remember to remove the key from your code when you're done, and never post it publicly. In Program.cs, replace YourSubscriptionKey with your Speech resource key, and replace YourServiceRegion with your Speech resource region. OutputSpeechRecognitionResult(speechRecognitionResult) Var speechRecognitionResult = await speechRecognizer.RecognizeOnceAsync() Using var speechRecognizer = new SpeechRecognizer(speechConfig, audioConfig) Ĭonsole.WriteLine("Speak into your microphone.") Using var audioConfig = AudioConfig.FromDefaultMicrophoneInput() SpeechConfig.SpeechRecognitionLanguage = "en-US" Var speechConfig = SpeechConfig.FromSubscription(YourSubscriptionKey, YourServiceRegion) Static void OutputSpeechRecognitionResult(SpeechRecognitionResult speechRecognitionResult)Ĭonsole.WriteLine($"RECOGNIZED: Text=") Ĭonsole.WriteLine($"CANCELED: Did you set the speech resource key and region values?") Static string YourServiceRegion = "YourServiceRegion" Static string YourSubscriptionKey = "YourSubscriptionKey" Replace the contents of Program.cs with the following code. Install the Speech SDK in your new project with the. Open a command prompt where you want the new project, and create a console application with the. You install the Speech SDK in the next section of this article, but first check the SDK installation guide for any more requirements Recognize speech from a microphoneįollow these steps to create a new console application and install the Speech SDK.
The Speech SDK is available as a NuGet package and implements. For more information about Cognitive Services resources, see Get the keys for your resource. After your Speech resource is deployed, select Go to resource to view and manage keys.
#SPEECH TO TEXT WINDOWS 10 FOR FREE#