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

# Voice and direct targeting

> Understand proximity voice, vehicle audio, PTT, and NPC selection.

HumaLike NPC voice uses the WebRTC client included in the resource and is
configured automatically from the server license. Mumble is not used to carry
NPC audio, and server owners do not configure a voice endpoint or voice
secrets.

When `pma-voice` is running, HumaLike only observes its radio and phone state to
avoid transmitting to NPCs during those conversations. Player voice remains
owned by the server's normal voice resource.

## Push to talk

Players speak to AI NPCs using HumaLike's push-to-talk binding. They can change
the binding in FiveM key settings. The HUD indicates whether HumaLike is
currently transmitting.

A custom HUD can subscribe on the client:

```lua theme={null}
AddEventHandler('humalike:voice:transmittingChanged', function(active)
    -- Update the server's voice indicator.
end)
```

## Which NPC hears the player

The resource continuously maintains a small set of direct conversation targets
so the HUD reflects the current routing before the player presses PTT. It
prioritizes:

1. An NPC following that player.
2. NPCs sharing the player's vehicle.
3. A nearby NPC the player's ped and gameplay camera are directed toward.

For an ordinary face-to-face conversation, the target must be close. If several
NPCs qualify by proximity and view direction, the closest one is selected.
Direct targets replace the ordinary unmuted audience for that utterance, which
prevents a nearby ambient NPC and a farther static NPC from both responding.

Following and same-vehicle relationships remain eligible beyond the normal
face-to-face range. This keeps a companion audible and responsive while moving
through a crowded area.

## Proximity and muted indicators

HumaLike limits how many NPC conversations are active around each player. The
label shows when an NPC is not currently in that player's listening set. Direct
target selection updates that state so the NPC the player is addressing is not
presented as unavailable while other nearby NPCs are temporarily muted.

Muting is per player. Two players in the same area can have different active
NPCs without changing the NPC globally.

## Vehicles

Players and NPCs in the same vehicle cabin remain voice-connected. An NPC that
is following a player is prioritized for that player, including after entering
a vehicle. Other players keep their own routing and priorities.

## Diagnose voice

Run `/voice` in the FiveM client to inspect the local connection. Also check:

* the browser/NUI microphone permission;
* the configured HumaLike PTT key;
* that the server license is valid;
* that the registered callback still points at this FXServer;
* that OneSync is enabled.

Enable `humalike_debug` only while diagnosing a problem. Do not publish logs
that contain connection URLs or credentials.

## Next

* [Configure HumaLike](/ai-npc/configuration).
* [Review following and vehicle behavior](/ai-npc/gameplay#following-and-vehicles).
* [Troubleshoot an NPC that does not answer](/ai-npc/operations#npc-does-not-answer).
