Skip to content

Commit 63797f3

Browse files
Update real-time-synthesis-avatar.md
1 parent 19416a8 commit 63797f3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ avatarSynthesizer.speakTextAsync(spokenText).then(
180180

181181
You can find end-to-end working samples on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/js/browser/avatar).
182182

183+
## Close the real-time avatar connection
184+
185+
To avoid unnecessary costs after you finish using the real-time avatar, it’s important to close the connection. There are several ways to do this:
186+
187+
- When the browser web page is closed, the WebRTC client side peer connection object will be released, and the avatar connection will be automatically closed after a few seconds.
188+
- If the avatar remains idle for 5 minutes, the connection will be automatically closed by the avatar service.
189+
- You can proactively close the avatar connection by running the following code:
190+
191+
```javascript
192+
avatarSynthesizer.close();
193+
```
194+
195+
You can find end-to-end working samples on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/js/browser/avatar).
196+
183197
## Edit background
184198

185199
The avatar real-time synthesis API currently doesn't support setting a background image/video and only supports setting a solid-color background, without transparent background support. However, there's an alternative way to implement background customization on the client side, following these guidelines:

0 commit comments

Comments
 (0)