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
+47-24Lines changed: 47 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.date: 03/12/2020
13
13
ms.author: donkim
14
14
---
15
15
16
-
# Fulfill commands from a client with the Speech SDK (Preview)
16
+
# Fulfill commands from a client with the Speech SDK
17
17
18
18
To complete tasks using a Custom Commands application you can send custom payloads to a connected client device.
19
19
@@ -28,17 +28,17 @@ In this article, you'll:
28
28
- An Azure subscription key for Speech service
29
29
-[Get one for free](get-started.md) or create it on the [Azure portal](https://portal.azure.com)
30
30
- A previously created Custom Commands app
31
-
-[Quickstart: Create a Custom Command with Parameters (Preview)](./quickstart-custom-speech-commands-create-parameters.md)
31
+
-[Quickstart: Create a Custom Command with Parameters](./quickstart-custom-speech-commands-create-parameters.md)
32
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)
33
+
-[Quickstart: Connect to a Custom Command application with the Speech SDK](./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.
0 commit comments