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/communication-services/how-tos/call-automation/includes/play-audio-with-ai-java.md
+38-27Lines changed: 38 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,12 +71,7 @@ You can test creating your own audio file using our [Speech synthesis with Audio
71
71
72
72
## (Optional) Connect your Azure Cognitive Service to your Azure Communication Service
73
73
74
-
If you would like to use Text-To-Speech capabilities, then it's required for you to connect your Azure Cognitive Service to your Azure Communication Service.
75
-
76
-
```code
77
-
az communication bind-cognitive-service --name “{Azure Communication resource name}” --resource-group “{Azure Communication resource group}” --resource-id “{Cognitive service resource id}” --subscription{subscription Name of Cognitive service} –identity{Cognitive Services Identity}
78
-
79
-
```
74
+
If you would like to use Text-To-Speech capabilities, then it's required for you to connect your [Azure Cognitive Service to your Azure Communication Service](../../../concepts/call-automation/azure-communication-services-azure-cognitive-services-integration.md).
80
75
81
76
## Update App.java with code
82
77
@@ -171,27 +166,30 @@ assertEquals(202, playResponse.getStatusCode()); // The request was accepted
171
166
172
167
Your application receives action lifecycle event updates on the callback URL that was provided to Call Automation service at the time of answering the call. An example of a successful play event update.
//Play audio failed, Take some action on failed event.
190
+
// Hang up call
191
+
callConnection.hangUp(true);
192
+
}
195
193
```
196
194
197
195
To learn more about other supported events, visit the [Call Automation overview document](../../../concepts/call-automation/call-automation.md#call-automation-webhook-events).
@@ -205,3 +203,16 @@ var callConnection = callAutomationAsyncClient.getCallConnectionAsync(<callConne
205
203
var cancelResponse = callConnection.getCallMediaAsync().cancelAllMediaOperationsWithResponse().block();
206
204
assertEquals(202, cancelResponse.getStatusCode()); // The request was accepted
207
205
```
206
+
207
+
### Example of how you can deserialize the *PlayCanceled* event:
0 commit comments