> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guiji.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

| Name           | Description                                                                                                                                                                                |
| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| error          | Triggered when there is an uncaught error.                                                                                                                                                 |
| bye            | Triggered when the session ends.                                                                                                                                                           |
| intialSucccess | Digital human initialization successful. You can call the `start` method in the callback of this event                                                                                     |
| show           | Digital human has been displayed.                                                                                                                                                          |
| progress       | Digital human loading progress.                                                                                                                                                            |
| speakSection   | Current audio and text segment of the digital human speaking (the answer method will get results in streaming mode, if calling speak separately, this event is consistent with speakStart) |
| speakStart     | There is a slight delay between driving the digital human to speak and the actual speaking, this event indicates that the digital human has actually started speaking                      |
| speakEnd       | Digital human has finished speaking                                                                                                                                                        |
| asrStart       | Single sentence speech recognition started                                                                                                                                                 |
| asrData        | Single sentence real-time speech recognition results                                                                                                                                       |
| asrStop        | Single sentence speech recognition ended                                                                                                                                                   |
| report         | Reports RTC network/picture quality and other information every second                                                                                                                     |

### error

```javascript theme={null}
{
  code: '', // error code 
  message: '', // error message 
  data: {} // error data
}

```

***error code***

| Name | Description                                      | data                                                                      |
| :--- | :----------------------------------------------- | :------------------------------------------------------------------------ |
| 3001 | RIC connection failed                            |                                                                           |
| 4001 | Failed to start session                          |                                                                           |
| 4005 | Authentication failed                            |                                                                           |
| 4007 | Server session abnormally ended                  | code: 100305 Model file not found                                         |
| 4008 | Failed to get microphone stream                  |                                                                           |
| 4009 | Browser cannot autoplay based on playback policy | Please consider muted playback or user operation to call the start method |

### progress

Progress of type number, 0-100

### speakSection

```javascript theme={null}

{
  audio: '', // audio src
  content: '', // audio content
}

```

### speakStart

```javascript theme={null}

{
  audio: '',
  content: '',
}

```

### speakEnd

```javascript theme={null}

{
  audio: '',
  content: '',
}

```

### asrData

The recognition of each text segment starts with an asrStart and ends with an asrStop, with one or more asrData (incremental push) in between. You can get speech recognition results in the asrData event for display.

```javascript theme={null}

{
  content: '',
}

```

### report

```javascript theme={null}
{
    "video": { // Video related information
        "download": {
            "frameWidth": 1920, // width
            "frameHeight": 1080,// height
            "framesPerSecond": 24,// frame rate
            "packetsLost": 0, // Total number of lost packets
            "packetsLostPerSecond": 0 // Total loss rate
        }
    },
    "connection": { // connection information
        "bytesSent": 206482, // Total number of bytes sent
        "bytesReceived": 79179770, // Total bytes received
        "currentRoundTripTime": 3, // Packet round trip time (milliseconds), the larger the time, the more delayed the screen
        "timestamp": 1688043940523,
        "receivedBitsPerSecond": 2978472, // Receive bit rate (number of bits received per second, 1Mb = 1024^2 bits)
        "sentBitsPerSecond": 7920 // Send bit rate (number of bits sent per second, 1Mb = 1024^2 bits)
    }
}
```

**Note:** Event parameters not listed in detail above are empty
