This sample demonstrates various forms of speech recognition, intent recognition, and translation using the Speech SDK for C++ on Windows.
- A subscription key for the Speech service. See Try the speech service for free.
- A Windows PC; some sample scenarios require a working microphone.
- Microsoft Visual Studio 2017, Community Edition or higher.
- The Desktop development with C++ workload in Visual Studio and the NuGet package manager component in Visual Studio. You can enable both in Tools > Get Tools and Features, under the Workloads and Individual components tabs, respectively.
-
By building this sample you will download the Microsoft Cognitive Services Speech SDK. By downloading you acknowledge its license, see Speech SDK license agreement.
-
Start Microsoft Visual Studio 2017 and select File > Open > Project/Solution.
-
Navigate to the folder containing this sample, and select the solution file contained within it.
-
To tailor the sample to your configuration, use search and replace across the whole solution (for example, via Edit > Find and Replace > Quick Replace) to update the following strings:
YourSubscriptionKey
: replace with your subscription key.YourServiceRegion
: replace with the region your subscription is associated with. For example,westus
ornortheurope
.YourEndpointId
(optional): replace with the endpoint ID of your customized model in CRIS.- The following settings apply for intent recognition powered by the Language Understanding service (LUIS):
YourLanguageUnderstandingSubscriptionKey
: replace with your Language Understanding service subscription key (endpoint key).YourLanguageUnderstandingServiceRegion
: replace with the region associated with your Language Understanding service subscription.YourLanguageUnderstandingAppId
: replace with the ID of a Language Understanding service application that you want to recognize intents with.YourLanguageUnderstandingIntentName1
,YourLanguageUnderstandingIntentName2
,YourLanguageUnderstandingIntentName3
: replace with names of intents that your Language Understanding service application recognizes.
-
Set the active solution configuration and platform to the desired values under Build > Configuration Manager:
- On a 64-bit Windows installation, choose
x64
as active solution platform. - On a 32-bit Windows installation, choose
x86
as active solution platform.
- On a 64-bit Windows installation, choose
-
Press Ctrl+Shift+B, or select Build > Build Solution.
Note If you are seeing red squigglies from IntelliSense for Speech SDK APIs, right-click into your editor window and select Rescan > Rescan Solution to resolve.
To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.
The app displays a menu that you can navigate using your keyboard. Choose the scenarios that you're interested in.