Skip to content

Commit

Permalink
Merge pull request #507 from sally-baolian/patch-19
Browse files Browse the repository at this point in the history
Real-time avatar connection
  • Loading branch information
prmerger-automator[bot] authored Sep 27, 2024
2 parents 78f1744 + 09238ae commit da6389d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ The limits in this table apply per Speech resource when you create a personal vo
| Quota | Free (F0)| Standard (S0) |
|-----|-----|-----|
| New connections per minute | Not available for F0 | 2 new connections per minute |
| Max connection duration with speaking | Not available for F0 | 10 minutes<sup>1</sup> |
| Max connection duration with idle state | Not available for F0 | 5 minutes |

<sup>1</sup> To ensure continuous operation of the real-time avatar for more than 10 minutes, you can enable auto-reconnect. For information about how to set up auto-reconnect, refer to this [sample code](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/js/browser/avatar/README.md) (search "auto reconnect").

#### Audio Content Creation tool

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ avatarSynthesizer.speakTextAsync(spokenText).then(

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).

## Close the real-time avatar connection

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:

- 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.
- If the avatar remains idle for 5 minutes, the connection will be automatically closed by the avatar service.
- You can proactively close the avatar connection by running the following code:

```javascript
avatarSynthesizer.close()
```

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).

## Edit background

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:
Expand Down

0 comments on commit da6389d

Please sign in to comment.