You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/how-to-custom-speech-commands-fulfill-sdk.md
+56-33Lines changed: 56 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@ title: How to fulfill commands from a client with the Speech SDK
3
3
titleSuffix: Azure Cognitive Services
4
4
description: In this article, we explain how to handle Custom Commands activities on a client with the Speech SDK.
5
5
services: cognitive-services
6
-
author: don-d-kim
7
-
manager: yetian
6
+
author: trevorbye
7
+
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: speech-service
11
11
ms.topic: conceptual
12
-
ms.date: 03/12/2020
13
-
ms.author: donkim
12
+
ms.date: 05/04/2020
13
+
ms.author: trbye
14
14
---
15
15
16
16
# Fulfill commands from a client with the Speech SDK (Preview)
@@ -23,22 +23,22 @@ In this article, you'll:
23
23
- Receive and visualize the custom JSON payload contents from a C# UWP Speech SDK client application
24
24
25
25
## Prerequisites
26
-
27
-
-[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
28
-
-An Azure subscription key for Speech service
29
-
-[Get one for free](get-started.md) or create it on the [Azure portal](https://portal.azure.com)
30
-
-A previously created Custom Commands app
31
-
-[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
32
-
-A Speech SDK enabled client application
33
-
-[Quickstart: Connect to a Custom Command application with the Speech SDK (Preview)](./quickstart-custom-speech-commands-speech-sdk.md)
26
+
> [!div class = "checklist"]
27
+
> *[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
28
+
> *An Azure subscription key for Speech service:
29
+
[Get one for free](get-started.md) or create it on the [Azure portal](https://portal.azure.com)
30
+
> *A previously created Custom Commands app:
31
+
[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
32
+
> *A Speech SDK enabled client application:
33
+
[Quickstart: Connect to a Custom Command application with the Speech SDK (Preview)](./quickstart-custom-speech-commands-speech-sdk.md)
34
34
35
35
## Optional: Get started fast
36
36
37
37
This article describes, step by step, how to make a client application to talk to your Custom Commands application. If you prefer to dive right in, the complete, ready-to-compile source code used in this article is available in the [Speech SDK Samples](https://aka.ms/csspeech/samples).
38
38
39
39
## Fulfill with JSON payload
40
40
41
-
1. Open your previously created Custom Commands application from the [Speech Studio](https://speech.microsoft.com/)
41
+
1. Open the Custom Commands application you previously created from [Quickstarts: Create a custom command with parameters](./quickstart-custom-speech-commands-create-parameters.md)
42
42
1. Check the **Completion Rules** section to make sure you have the previously created rule that responds back to the user
43
43
1. To send a payload directly to the client, create a new rule with a Send Activity action
44
44
@@ -51,9 +51,7 @@ This article describes, step by step, how to make a client application to talk t
51
51
| Conditions | Required Parameter - `OnOff` and `SubjectDevice`| Conditions that determine when the rule can run |
52
52
| Actions |`SendActivity` (see below) | The action to take when the rule condition is true |
In [Quickstart: Connect to a Custom Command application with the Speech SDK (Preview)](./quickstart-custom-speech-commands-speech-sdk.md) you created a Speech SDK client application that handled commands such as `turn on the tv`, `turn off the fan`. Now add some visuals so you can see the result of those commands.
68
+
In [Quickstart: Connect to a Custom Command application with the Speech SDK](./quickstart-custom-speech-commands-speech-sdk.md), you created a Speech SDK client application that handled commands such as `turn on the tv`, `turn off the fan`. With some visuals added, you can see the result of those commands.
69
69
70
-
Add labeled boxes with text indicating **On** or **Off** using the following XML added to `MainPage.xaml.cs`
70
+
Add labeled boxes with text indicating **On** or **Off** using the following XML added to `MainPage.xaml`
In `InitializeDialogServiceConnector` add the following to your `ActivityReceived` event handler. The additional code will extract the payload from the activity and change the visual state of the tv or fan accordingly.
100
+
In `MainPage.xaml.cs', add
101
+
-`using Newtonsoft.Json;`
102
+
-`using Windows.ApplicationModel.Core;`
103
+
104
+
### Handle received payload
105
+
106
+
In `InitializeDialogServiceConnector`, replace the `ActivityReceived` event handler with following code. The modified `ActivityReceived` event handler will extract the payload from the activity and change the visual state of the tv or fan accordingly.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/quickstart-custom-speech-commands-select-custom-voice.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,8 @@ In this article, we'll select a custom output voice for the application we creat
30
30
> 
31
31
32
32
> [!NOTE]
33
-
> Custom voices can be created from the Custom Voice project page. Select the **Speech Studio** link, then **Custom Voice** to get started.
33
+
> - For **Public voices**, **Neural types** are only available for specific regions. To check availability, see [standard and neural voices by region/endpoint](https://docs.microsoft.com/azure/cognitive-services/speech-service/regions#standard-and-neural-voices).
34
+
> - For **Custom voices**, they can be created from the Custom Voice project page. See [Get Started with Custom Voice](./how-to-custom-voice.md).
34
35
35
36
Now the application will respond in the selected voice, instead of the default voice.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Speech-Service/quickstart-custom-speech-commands-speech-sdk.md
+19-9Lines changed: 19 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,32 +19,34 @@ After creating a hosted Custom Commands application, you can begin talking to it
19
19
In this article, you'll:
20
20
21
21
- Publish a Custom Commands application and get an application identifier (App ID)
22
-
- Create a client app using the Speech SDK to allow you to talk to your Custom Commands application
22
+
- Create a Universal Windows Platform (UWP) client app using the Speech SDK to allow you to talk to your Custom Commands application
23
23
24
24
## Prerequisites
25
25
26
26
A Custom Commands application is required to complete this article. If you haven't created a Custom Commands application yet, you can do so in these previous quickstarts:
27
-
28
-
-[Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
29
-
-[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
27
+
> [!div class = "checklist"]
28
+
> *[Quickstart: Create a Custom Command (Preview)](./quickstart-custom-speech-commands-create-new.md)
29
+
> *[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
30
30
31
31
You'll also need:
32
-
33
-
-[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
34
-
- An Azure subscription key for Speech Services. [Get one for free](get-started.md) or create it on the [Azure portal](https://portal.azure.com)
32
+
> [!div class = "checklist"]
33
+
> *[Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)
34
+
> * An Azure subscription key for Speech Services. [Get one for free](get-started.md) or create it on the [Azure portal](https://portal.azure.com)
35
+
> *[Enable your device for development](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development)
35
36
36
37
## Optional: Get started fast
37
38
38
39
This quickstart describes, step by step, how to make a client application to connect to your Custom Commands app. If you prefer to dive right in, the complete, ready-to-compile source code used in this quickstart is available in the [Speech SDK Samples](https://aka.ms/csspeech/samples) under the `quickstart` folder.
39
40
40
41
## Step 1: Publish Custom Commands application
41
42
42
-
1. Open your [previously created Custom Commands application](./quickstart-custom-speech-commands-create-new.md) and select **Publish**
43
+
1. Open your [previously created Custom Commands application (Preview)](./quickstart-custom-speech-commands-create-new.md) and select **Publish**
1. Copy the App ID from the publish notification for later use
49
+
1. Copy the Speech Resource Key for later use
48
50
49
51
## Step 2: Create a Visual Studio project
50
52
@@ -124,7 +126,7 @@ Add the code-behind source as follows:
124
126
125
127
1. In **Solution Explorer**, open the code-behind source file `MainPage.xaml.cs` (grouped under `MainPage.xaml`)
126
128
127
-
1. Replace the file's contents with the following code:
129
+
1. Replace the file's contents with the following code:
128
130
129
131
```csharp
130
132
usingMicrosoft.CognitiveServices.Speech;
@@ -293,6 +295,11 @@ Add the code-behind source as follows:
293
295
}
294
296
}
295
297
```
298
+
> [!NOTE]
299
+
> If you see error: "The type 'Object' is defined in an assembly that is not referenced"
300
+
> 1. Right-client your solution.
301
+
> 1. Choose **Manage NuGet Packages for Solution**, Select **Updates**
302
+
> 1. If you see **Microsoft.NETCore.UniversalWindowsPlatform** in the update list, Update **Microsoft.NETCore.UniversalWindowsPlatform** to newest version
296
303
297
304
1. Add the following code to the method body of `InitializeDialogServiceConnector`
298
305
@@ -414,3 +421,6 @@ Add the code-behind source as follows:
414
421
> [!div class="nextstepaction"]
415
422
> [How to: Fulfill commands on the client with the Speech SDK (preview)](./how-to-custom-speech-commands-fulfill-sdk.md)
416
423
> [How To: Add validations to Custom Command parameters (Preview)](./how-to-custom-speech-commands-validations.md)
424
+
425
+
## Sample source code
426
+
Check out our client sample codes at [GitHub-VoiceAssistant](https://github.com/Azure-Samples/Cognitive-Services-Voice-Assistant)
0 commit comments