Skip to main content
Skip table of contents

StartSession

The StartSession methods initiate the connection to the Rapport service. They establish the WebRTC peer connection and set up audio handling. The session must be started and ready before you can bind a player.

StartSession(IRapportAudioInput audioInput)

  • Description: Starts a Rapport session by setting up the audio input and establishing a connection with the service. This method internally calls the asynchronous StartSessionAsync() method.

  • Parameters:

    • IRapportAudioInput audioInput: The audio input to be used for sending audio data from the user to the server.

StartSessionAsync()

  • Description: An asynchronous method that handles the core logic of starting the session. It ensures only one session can be started at a time, creates the RapportRTCConnection, and initiates the AI session.

  • Key Actions:

    • Connection: Establishes a connection to the Rapport service.

    • Error Handling: Includes try-catch blocks to handle and report any connection or session start failures.

    • State Management: Updates the sessionStarted flag and sends events to notify listeners of connection status changes (NetworkEvent.Connecting, NetworkEvent.Connected).

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.