# In-call quality monitoring (/en/realtime-media/voice/build/manage-connection-and-quality/in-call-quality-monitoring)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

During a call, Voice SDK triggers callbacks and exposes statistics related to voice calling quality. Use these signals to monitor user experience, troubleshoot audio issues, and adjust your app when network conditions change.

## Understand the tech [#understand-the-tech]

After a user joins a channel, Voice SDK reports information such as uplink and downlink network quality, real-time interaction statistics, and statistics for local and remote audio streams.

To monitor call quality, Agora provides the following notifications and statistics:

**Network quality**

The network quality callback provides insight into the uplink and downlink last-mile network quality for each participant in the channel. Last mile refers to the network from your device to Agora servers. Network quality scores are calculated based on factors such as bitrate, packet loss rate, round-trip delay, and network jitter.

**Interaction statistics**

The statistics callback reports key metrics such as call duration, the number of participants, system CPU usage, and app CPU usage.

**Audio quality**

Audio quality callbacks and statistics cover both local and remote audio streams. You can monitor bitrate, delay, packet loss, and audio state changes to understand voice quality and diagnose call issues.

## Prerequisites [#prerequisites]

Ensure that you have implemented the [SDK quickstart](/en/realtime-media/voice/quickstart) in your project.

## Implement in-call quality monitoring [#implement-in-call-quality-monitoring]

For native SDKs, implement the following real-time interaction quality statistics callbacks and audio state monitoring callbacks:

| Callback                    | Description                                              |
| --------------------------- | -------------------------------------------------------- |
| `onNetworkQuality`          | Reports uplink and downlink last-mile network quality.   |
| `onRtcStats`                | Reports real-time interaction statistics.                |
| `onLocalAudioStats`         | Reports statistics for the sent audio stream.            |
| `onLocalAudioStateChanged`  | Reports local audio stream state changes.                |
| `onRemoteAudioStats`        | Reports statistics for the received remote audio stream. |
| `onRemoteAudioStateChanged` | Reports remote audio stream state changes.               |

For Web SDK, use the following event and methods:

| Event or method       | Description                                            |
| --------------------- | ------------------------------------------------------ |
| `network-quality`     | Reports uplink and downlink last-mile network quality. |
| `getRTCStats`         | Gets real-time interaction statistics.                 |
| `getLocalAudioStats`  | Gets statistics for the sent audio stream.             |
| `getRemoteAudioStats` | Gets statistics for the received remote audio stream.  |

## Reference [#reference]

### Network quality score [#network-quality-score]

| Value | Description                                                                                 |
| ----- | ------------------------------------------------------------------------------------------- |
| `0`   | The network quality is unknown.                                                             |
| `1`   | The network quality is excellent.                                                           |
| `2`   | The network quality is good, but the bitrate may be slightly lower than excellent.          |
| `3`   | Users may experience a slight decrease in call quality.                                     |
| `4`   | The network quality is poor, and users may be unable to make smooth calls.                  |
| `5`   | The network quality is extremely poor, making it almost impossible for users to make calls. |
| `6`   | The network is down, and the user cannot make a call.                                       |

### API reference [#api-reference]

* [`onNetworkQuality`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onnetworkquality)
* [`onRtcStats`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onrtcstats)
* [`onLocalAudioStats`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onlocalaudiostats)
* [`onLocalAudioStateChanged`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onlocalaudiostatechanged)
* [`onRemoteAudioStats`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onremoteaudiostats)
* [`onRemoteAudioStateChanged`](https://api-ref.agora.io/en/video-sdk/android/4.x/API/class_irtcengineeventhandler.html#callback_irtcengineeventhandler_onremoteaudiostatechanged)
* [`network-quality`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartcclient.html#event_network_quality)
* [`getRTCStats`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartcclient.html#getrtcstats)
* [`getLocalAudioStats`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartcclient.html#getlocalaudiostats)
* [`getRemoteAudioStats`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartcclient.html#getremoteaudiostats)
