Skip to content

Commit a3a5493

Browse files
Update real-time-synthesis-avatar.md
1 parent 33b3b60 commit a3a5493

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

articles/ai-services/speech-service/text-to-speech-avatar/real-time-synthesis-avatar.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,18 @@ const avatarConfig = new SpeechSDK.AvatarConfig(
8282

8383
Real-time avatar uses WebRTC protocol to output the avatar video stream. You need to set up the connection with the avatar service through WebRTC peer connection.
8484

85-
First, you need to create a WebRTC peer connection object. WebRTC is a P2P protocol, which relies on ICE server for network relay. Azure provides [Communication Services](../../../communication-services/overview.md), which can provide network relay function. Therefore, we recommend you fetch the ICE server from the Azure Communication resource, which is mentioned in the [prerequisites section](#prerequisites). You can also choose to use your own ICE server.
85+
First, you need to create a WebRTC peer connection object. WebRTC is a P2P protocol, which relies on ICE server for network relay. Speech service provides network relay function and exposes a REST API to issue the ICE server information. Therefore, we recommend you fetch the ICE server from the speech service. You can also choose to use your own ICE server.
8686

87-
The following code snippet shows how to create the WebRTC peer connection. The ICE server URL, ICE server username, and ICE server credential can all be fetched from the network relay token you prepared in the [prerequisites section](#prerequisites) or from the configuration of your own ICE server.
87+
Here is a sample request to fetch ICE information from the speech service endpoint:
88+
89+
```HTTP
90+
GET /cognitiveservices/avatar/relay/token/v1 HTTP/1.1
91+
92+
Host: westus2.tts.speech.microsoft.com
93+
Ocp-Apim-Subscription-Key: YOUR_RESOURCE_KEY
94+
```
95+
96+
The following code snippet shows how to create the WebRTC peer connection. The ICE server URL, ICE server username, and ICE server credential can all be fetched from the payload of above HTTP request.
8897

8998
```JavaScript
9099
// Create WebRTC peer connection

0 commit comments

Comments
 (0)