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-csharp.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,11 +41,8 @@ You can test creating your own audio file using our [Speech synthesis with Audio
41
41
42
42
## (Optional) Connect your Azure Cognitive Service to your Azure Communication Service
43
43
44
-
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.
45
-
```code
46
-
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}
44
+
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).
47
45
48
-
```
49
46
## Establish a call
50
47
51
48
By this point you should be familiar with starting calls, if you need to learn more about making a call, follow our [quickstart](../../../quickstarts/call-automation/callflows-for-customer-interactions.md). In this quickstart, we answer an incoming call.
@@ -66,44 +63,58 @@ Once the call has been established, there are multiple options for how you may w
66
63
67
64
### Play source - Audio file
68
65
69
-
To play audio to participants using audio files, you need to make sure the audio file is a WAV file, mono and 16 KHz. To play audio files you need to make sure you provide ACS with a uri to a file you host in a location where ACS can access it.
66
+
To play audio to participants using audio files, you need to make sure the audio file is a WAV file, mono and 16 KHz. To play audio files you need to make sure you provide ACS with a uri to a file you host in a location where ACS can access it. The FileSource type in our SDK can be used to specify audio files for the play action.
To play audio using Text-To-Speech through Azure Cognitive Services you need to provide the text you wish to play, as well either the SourceLocale, and VoiceGender or the VoiceName you wish to use.
74
+
To play audio using Text-To-Speech through Azure Cognitive Services you need to provide the text you wish to play, as well either the SourceLocale, and VoiceGender or the VoiceName you wish to use. We support all voice names supported by Cognitive Services, full list [here]().
78
75
79
76
```csharp
80
77
StringtextToPlay="Welcome to Contoso";
78
+
79
+
//you can provide SourceLocale and VoiceGender as one option for playing audio
81
80
TextSourceplaySource=newTextSource(textToPlay);
82
81
{
83
82
SourceLocale="en-US",
84
-
VoiceGender=GenderType.Female,
85
-
VoiceName="en-US-ElizabethNeural"
83
+
VoiceGender=GenderType.Female,
86
84
};
87
85
```
88
86
89
-
## Play audio to a specific participant
87
+
```csharp
88
+
StringtextToPlay="Welcome to Contoso";
90
89
91
-
In this scenario audio is played to a specific participant.
90
+
//you can provide VoiceName
91
+
TextSourceplaySource=newTextSource(textToPlay);
92
+
{
93
+
VoiceName="en-US-ElizabethNeural"
94
+
};
95
+
```
96
+
97
+
Once you've decided on which playSource you wish to use for playing audio you can then choose whether you want to play it to a specific participant or to all participants.
98
+
99
+
100
+
## Play audio to all participants
101
+
102
+
In this scenario audio is played to all participants on the call.
0 commit comments