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

# Voice

```bash theme={null}
telnyx-acp set voice.greeting "Hello, how can I help?"
telnyx-acp set voice.harness true
```

```text {2,5,16,17,18} theme={null}
support-agent/
├── agent.json                                         ◀
├── instructions.md
└── .telnyx/                        written by deploy
    ├── index.ts                                       ◀
    ├── telnyx.toml
    ├── telnyx-env.d.ts
    └── package.json

@telnyx/acp/                      the package
├── managed/
│   ├── index.ts
│   ├── agent.ts
│   ├── model.ts
│   ├── memory.ts
│   ├── tools.ts
│   ├── mcp.ts
│   ├── voice.ts                                       ◀
│   ├── direct-turn.ts                                 ◀
│   └── filler.ts                                      ◀
├── channels/
│   ├── index.ts
│   ├── phone.ts
│   ├── email.ts
│   ├── web.ts
│   └── wire.ts
├── synth/
│   ├── index.ts
│   ├── code-entry.ts
│   └── vendor.ts
└── spec/
    ├── schema.ts
    ├── model.ts
    ├── phone.ts
    ├── project.ts
    └── io.ts
```

`voice` is written by `set voice.*`, or its `greeting` by the wizard when the project has a number. It becomes `spec.voice` in `.telnyx/index.ts`, and four functions in `managed/voice.ts` read it:

```ts theme={null}
// managed/voice.ts
export function answerOptions(spec) {
  const v = spec.voice ?? {};
  return { eager: v.eager ?? true, ...(v.bargeIn !== undefined ? { bargeIn: v.bargeIn } : {}),
           ...(v.keypressInterrupts !== undefined ? { keypressInterrupts: v.keypressInterrupts } : {}) };
}
export function speechOptionsFor(spec) {
  const v = spec.voice ?? {};
  return { recognizer: { ...(v.stt ?? {}) },
           synthesizer: { voice: v.tts?.voice ?? DEFAULT_TTS_VOICE, ...(v.tts?.voiceSettings ? { voiceSettings: v.tts.voiceSettings } : {}) } };
}
export function defaultGreeting(spec) {
  return spec.voice?.greeting?.trim() || `Hi, this is ${spec.name.replace(/[-_]+/g, " ")}. How can I help?`;
}
export function harnessOnCalls(spec) {
  return spec.voice?.harness === true;
}
```

* `answerOptions` is what the voice class passes to the `voice()` mixin's `answer` when the media socket opens, as [The Call Webhook](/docs/agent-sdk/inside/request-handling/call-webhook) shows.
* `speechOptionsFor` feeds `speechProvidersFor`, which builds the STT and TTS providers.
* `defaultGreeting` is returned by the voice class's `greeting`, and spoken when the call is answered.
* `harnessOnCalls` chooses the turn engine, the direct engine in `managed/direct-turn.ts` by default and the harness when `voice.harness` is true.

`answerOptions(spec)` sets the mixin's call options.

* `eager` is on unless `voice.eager` is false. A turn then starts on STT's first guess that the caller has finished, and its audio is held until the guess is confirmed.
* `bargeIn` and `keypressInterrupts` are passed only when `voice` sets them, and the mixin's own defaults apply otherwise.

`speechProvidersFor` hands the speech options to the runtime SDK:

```ts theme={null}
// managed/voice.ts
export function speechProvidersFor(spec, make = telnyxSpeechProviders) {
  return make(speechOptionsFor(spec));
}
```

`telnyxSpeechProviders(options)` is the Telnyx STT and TTS pair from [`@telnyx/edge-runtime/voice`](/docs/agent-sdk/runtime-sdk). Its `recognizer` option tunes STT and its `synthesizer` option tunes TTS. Both reach Telnyx over the runtime's own connection, with no credential in the class.

A fifth, `fillerOptions` in `managed/filler.ts`, reads `voice.filler`:

```ts theme={null}
// managed/filler.ts
export function fillerOptions(spec) {
  const f = spec.voice?.filler;
  if (f === false) return undefined;
  return { afterMs: f?.afterMs ?? DEFAULT_FILLER_AFTER_MS,
           phrases: f?.phrases?.length ? f.phrases : DEFAULT_FILLER_PHRASES,
           maxPerCall: f?.maxPerCall ?? 0 };
}
```

`fillerOptions` is what the voice class's `reply` uses to say one short phrase when the model is slow to start. `DEFAULT_FILLER_AFTER_MS` is 700, and the default phrases are "One moment.", "Let me check that for you." and "Sure, just a second.". [The Voice Loop](/docs/agent-sdk/inside/turn-taking/voice-loop) is where the phrase is spoken.

[Voice](/docs/agents/voice) is the user-facing side of the same fields.
