RapportSession
Nested Classes
WaitForSessionReady
CustomYieldInstruction that waits for the session to be started, connected to the rapport web services, and ready to receive animation and audio data.
WaitForSessionStopped
CustomYieldInstruction that waits for a session to be properly stopped.
Fields
Name | Type | Description |
|---|---|---|
RotationOffset | Vector3 | The rotation offset between the web version of the character and how its represented in unity. |
ScaleOffset | Vector3 | The scale offset between the web version of the character and how its represented in unity |
Properties
Name | Type | Description |
|---|---|---|
Events | RapportEvents | A powerful event system that allows your scripts to subscribe and react to various occurrences during a session's lifecycle. These events are essential for building a responsive user interface and handling real-time changes in the session's status. |
Modules | RapportModules | The RapportModules API is a centralized toolset for integrating core functionalities like facial animation, text-to-speech, speech recognition, and AI interaction. |
SessionDiagnostics | RapportSessionDiagnostics | This class is a diagnostic tool designed to help you monitor the performance of your Rapport session. It provides real-time data on key metrics, such as system time and animation latency. See RapportSessionDiagnostics |
IsReady | bool | Returns true when the session is ready to animate and output audio data. |
Methods
Name | Return Type | Description |
|---|---|---|
WaitUntilReady() | This custom yield instruction is used to pause a coroutine until the associated RapportSession is in a fully ready state. It will keep waiting until both | |
WaitUntilStopped() | This custom yield instruction is used to pause a coroutine until the associated RapportSession has completely stopped. It will continue waiting as long as either | |
BindPlayer(AudioSource outputAudioSource, Animator animator, Vector3? RotationOffset, Vector3? ScaleOffset) | bool | The |
BindPlayer(int id, AudioSource outputAudioSource, Animator animator, Vector3? RotationOffset, Vector3? ScaleOffset) | bool | This is the primary implementation of |
StartSession(IRapportAudioInput audioInput) | void | Starts a Rapport session by setting up the audio input and establishing a connection with the service. This method internally calls the asynchronous |
async Task | This method initiates a new session, which is necessary for real-time communication. It sets up the peer connection and prepares the system to handle audio and data. Note: This method will NOT work without a valid audio input. | |
StopSession() | void | This method serves as a public entry point to stop the session. It calls the asynchronous |
StopSessionAsync | async Task | This method safely stops the session. It handles the disconnection, cleans up resources, and resets the session's status to ensure everything is properly shut down. |
RestartSession(bool rebindPlayers) | void | This method immediately initiates the process of restarting the session without waiting for it to complete. if rebindPlayers parameter is true, it will also handle the re-connection of existing players to the new session. |
RestartSessionAsync(bool rebindPlayers) | async Task | This method gracefully stops the current session and then starts a brand new one. It also handles the re-connection of existing players to the new session. |
SetPlayerAnimationBlend(int id, float blendAmount) | void | This method controls how much a player's animation is influenced by the Rapport system. You can blend between the player's standard animator and the real-time Rapport animation. |
SetPlayerAnimationBlend(float blendAmount) | void | This is a simplified version of the method above that sets the animation blend for the main player (ID 0). |