# RoomClient: peers event

> The peers event of the RoomClient interface fires when the players this player hears, or is heard by, change.

The **`peers`** event of the [`RoomClient`](/docs/client/room-client) interface fires when [`peers`](/docs/client/room-client/peers) changes: the players this player hears, or is heard by, as the room decides.

## Syntax

```ts
addEventListener("peers", (event) => {})
```

## Event type

A `CustomEvent` whose `detail` is the new `room.peers`, an object with these properties:

`speakers`
: A read-only array of the player IDs this player hears.

`listeners`
: A read-only array of the player IDs that hear this player.

## Description

The room decides who hears whom, with its voice settings, and the router sends the result whenever it changes. Each reconnect empties `room.peers` until the room sends it again, and fires `peers` with both lists empty if they weren't already.

`peers` follows what the room decided, not who is on the voice server. The `Voice` object of [`joinVoice()`](/docs/client/joinvoice) has the players on the voice server.

## Examples

### Showing who is in earshot

A survival game lists the players this one can hear.

```ts
// earshot.ts
import { connect } from "@irtio/client";

const room = await connect("https://rooms.irt.io/my-game/camp");
const earshot = document.querySelector("#earshot")!;

room.addEventListener("peers", ({ detail: peers }) => {
  earshot.textContent = peers.speakers.length === 0 ? "No one in earshot" : `Hearing ${peers.speakers.join(", ")}`;
});
```

## See also

- [`RoomClient.peers`](/docs/client/room-client/peers)
- [`voice` event](/docs/client/room-client/voice-event)
- [Proximity voice](/docs/room/guides/voice#client), for joining voice on the client
