5/18/2019»»Saturday

No Recognizer Is Installed C#

5/18/2019
    52 - Comments
No Recognizer Is Installed C# Rating: 8,5/10 6366 votes

A read-only collection of the RecognizerInfo objects that describe the installed recognizers. Remarks To get information about the current recognizer, use the RecognizerInfo property.

-->

Quickstarts are also available for text-to-speech and speech-translation.

If desired, choose a different programming language and/or environment:

Use this guide to create a speech-to-text console application using the .NET framework for Windows and the Speech SDK. When finished, you can use your computer's microphone to transcribe speech to text in real time.

For a quick demonstration (without building the Visual Studio project yourself as shown below):

Get the latest Cognitive Services Speech SDK Samples from GitHub.

Prerequisites

To complete this project, you'll need:

  • A subscription key for the Speech Service. Get one for free.
  • Access to your computer's microphone

Create a Visual Studio project

  1. Start Visual Studio 2017.

  2. From the menu bar in Visual Studio, select Tools > Get Tools and make sure that the .NET desktop development workload is available. If the workload hasn't been installed, mark the checkbox, then click Modify to start the installation. It may take a few minutes to download and install.

    If the checkbox next to .NET desktop development is selected, you can close the dialog box now.

  3. Next, let's create a project. From the menu bar select File > New > Project. When the dialog box appears, from the left panel expand these sections Installed > Visual C# > Windows Desktop and select Console App (.NET Framework). Name this project helloworld.

  4. Now that the project is set up, we need to install the Speech SDK NuGet package and reference it in our code. Locate the Solution Explorer and right-click on helloworld. From the menu, select Manage NuGet Packages...

  5. In the upper-right corner of the NuGet Package Manager, locate the Package Source dropdown and make sure that nuget.org is selected. Then, select Browse and search for the Microsoft.CognitiveServices.Speech package and install the latest stable version.

  6. Accept all agreements and licenses to start the installation.

    After the package is installed, a confirmation appears in the Package Manager console.

  7. The next step is to create a platform configuration that matches the architecture of the computer you're using to build and run the console application. From the menu bar, select Build > Configuration Manager...

  8. In the Configuration Manager dialog box, locate the Active solution platform drop-down list, and select New.

  9. If you are running 64-bit Windows, when prompted with Type or select the new platform, x64. If you are running 32-bit Windows, select x86. When you're finished, click OK.

Add sample code

  1. Open Program.cs and replace the automatically generated code with this sample:

  2. Locate and replace the string YourSubscriptionKey with your Speech Services subscription key.

  3. Locate and replace the string YourServiceRegion with the region associated with your subscription. For example, if you're using the free trial, the region is westus.

  4. Save the changes to the project.

Build and run the app

  1. From the menu bar, select Build > Build Solution. The code should compile without errors now.

  2. From the menu bar, select Debug > Start Debugging, or press F5 to start the application.

  3. A console window will appear, prompting you to speak. Now, say something in English. Your speech is transmitted to the Speech Services and transcribed to text in real time. The result is printed to the console.

Next steps

See also

-->

Definition

Overloads

SpeechRecognitionEngine()SpeechRecognitionEngine()SpeechRecognitionEngine()

Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for the system.

SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)

Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for a specified locale.

SpeechRecognitionEngine(RecognizerInfo)SpeechRecognitionEngine(RecognizerInfo)SpeechRecognitionEngine(RecognizerInfo)

Initializes a new instance of the SpeechRecognitionEngine using the information in a RecognizerInfo object to specify the recognizer to use.

SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)

Initializes a new instance of the SpeechRecognitionEngine class with a string parameter that specifies the name of the recognizer to use.

Remarks

No Recognizer Is Installed C#

You can construct a SpeechRecognitionEngine instance from any of the following:

  • The default speech recognition engine for the system

  • A specific speech recognition engine that you specify by name

  • The default speech recognition engine for a locale that you specify

  • A specific recognition engine that meets the criteria that you specify in a RecognizerInfo object.

Before the speech recognizer can begin recognition, you must load at least one speech recognition grammar and configure the input for the recognizer.

To load a grammar, call the LoadGrammar or LoadGrammarAsync method.

To configure the audio input, use one of the following methods:

SpeechRecognitionEngine()SpeechRecognitionEngine()SpeechRecognitionEngine()

Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for the system.

Remarks

Before the speech recognizer can begin speech recognition, you must load at least one recognition grammar and configure the input for the recognizer.

To load a grammar, call the LoadGrammar or LoadGrammarAsync method.

To configure the audio input, use one of the following methods:

SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)SpeechRecognitionEngine(CultureInfo)

Initializes a new instance of the SpeechRecognitionEngine class using the default speech recognizer for a specified locale.

Parameters

culture
CultureInfoCultureInfoCultureInfoCultureInfo

The locale that the speech recognizer must support.

Exceptions

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

None of the installed speech recognizers support the specified locale, or culture is the invariant culture.

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

Culture is null.

Examples

The following example shows part of a console application that demonstrates basic speech recognition, and initializes a speech recognizer for the en-US locale.

Remarks

Microsoft Windows and the System.Speech API accept all valid language-country codes. To perform speech recognition using the language specified in the CultureInfo argument, a speech recognition engine that supports that language-country code must be installed. The speech recognition engines that shipped with Microsoft Windows 7 work with the following language-country codes.

  • en-GB. English (United Kingdom)

    7 Jun Naruto Shippuden Subtitle IndonesiaDibawah ini merupakan list 3GPEpisodeMKV PMKV P MP4 3GP AVINS Sub Indo Episode, MKV P, MKV P, MP4, 3GP, AVI. Download one piece subtitle indonesia.

  • en-US. English (United States)

  • de-DE. German (Germany)

  • es-ES. Spanish (Spain)

  • fr-FR. French (France)

  • ja-JP. Japanese (Japan)

  • zh-CN. Chinese (China)

  • zh-TW. Chinese (Taiwan)

Two-letter language codes such as 'en', 'fr', or 'es' are also permitted.

Before the speech recognizer can begin recognition, you must load at least one speech recognition grammar and configure the input for the recognizer.

To load a grammar, call the LoadGrammar or LoadGrammarAsync method.

To configure the audio input, use one of the following methods:

SpeechRecognitionEngine(RecognizerInfo)SpeechRecognitionEngine(RecognizerInfo)SpeechRecognitionEngine(RecognizerInfo)

Initializes a new instance of the SpeechRecognitionEngine using the information in a RecognizerInfo object to specify the recognizer to use.

Parameters

recognizerInfo
RecognizerInfoRecognizerInfoRecognizerInfoRecognizerInfo

The information for the specific speech recognizer.

Examples

The following example shows part of a console application that demonstrates basic speech recognition, and initializes a speech recognizer that supports the English language.

Remarks

You can create an instance of this class for any of the installed speech recognizers. To get information about which recognizers are installed, use the InstalledRecognizers method.

Before the speech recognizer can begin recognition, you must load at least one speech recognition grammar and configure the input for the recognizer.

To load a grammar, call the LoadGrammar or LoadGrammarAsync method.

To configure the audio input, use one of the following methods:

SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)SpeechRecognitionEngine(String)

Initializes a new instance of the SpeechRecognitionEngine class with a string parameter that specifies the name of the recognizer to use.

Parameters

recognizerId
StringStringStringString
Recognizer

The token name of the speech recognizer to use.

Exceptions

ArgumentExceptionArgumentExceptionArgumentExceptionArgumentException

No speech recognizer with that token name is installed, or recognizerId is the empty string (').

ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionArgumentNullException

recognizerId is null.

Examples

The following example shows part of a console application that demonstrates basic speech recognition, and creates an instance of the Speech Recognizer 8.0 for Windows (English - US).

Remarks

The token name of the recognizer is the value of the Id property of the RecognizerInfo object returned by the RecognizerInfo property of the recognizer. To get a collection of all the installed recognizers, use the static InstalledRecognizers method.

Before the speech recognizer can begin recognition, you must load at least one speech recognition grammar and configure the input for the recognizer.

To load a grammar, call the LoadGrammar or LoadGrammarAsync method.

To configure the audio input, use one of the following methods:

Applies to