---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tts/native/adapter/classes/NativeTtsAdapter.md
description: >-
  TTS adapter that shells out to the OS's own speech binary. Reusable: construct
  once, call [`NativeTtsAdapter.synthesize`](https://adk.nht.io/api/@nhtio/adk/batteries/tts/native/adapter/classes/NativeTtsAdapter#synthesize) as many times as needed.
---

# Class: NativeTtsAdapter

Defined in: [src/batteries/tts/native/adapter.ts:65](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L65)

TTS adapter that shells out to the OS's own speech binary. Reusable: construct once, call
[NativeTtsAdapter.synthesize](#synthesize) as many times as needed.

## Remarks

A zero-config `new NativeTtsAdapter()` is valid — it auto-detects the platform from
`process.platform` at `synthesize` time and resolves the default executor / fs / scratch-path
seams lazily.

## Constructors

### Constructor

```ts
new NativeTtsAdapter(options?: unknown): NativeTtsAdapter;
```

Defined in: [src/batteries/tts/native/adapter.ts:86](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L86)

#### Parameters

| Parameter | Type      | Description                                                                                                                                                                                                        |
| --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | `unknown` | Constructor options. **All optional**; validated eagerly against [@nhtio/adk/batteries/tts/native!nativeTtsOptionsSchema](../../validation/variables/nativeTtsOptionsSchema.md). Pass `undefined` for zero-config. |

#### Returns

`NativeTtsAdapter`

#### Throws

[@nhtio/adk/batteries/tts/native!E\_INVALID\_NATIVE\_TTS\_OPTIONS](../../exceptions/variables/E_INVALID_NATIVE_TTS_OPTIONS.md) when invalid.

## Methods

### isAvailable()

```ts
isAvailable(): boolean;
```

Defined in: [src/batteries/tts/native/adapter.ts:91](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L91)

Instance availability probe (honours an injected `isAvailable`).

#### Returns

`boolean`

***

### preload()

```ts
preload(): Promise<void>;
```

Defined in: [src/batteries/tts/native/adapter.ts:96](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L96)

No-op. The native engine has nothing to preload — the binary is invoked fresh per call.

#### Returns

`Promise`<`void`>

***

### reset()

```ts
reset(): void;
```

Defined in: [src/batteries/tts/native/adapter.ts:101](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L101)

No-op. The native engine holds no state between calls to reset.

#### Returns

`void`

***

### synthesize()

```ts
synthesize(text: string, opts?: NativeSynthesizeOptions): Promise<GeneratedMediaOutput>;
```

Defined in: [src/batteries/tts/native/adapter.ts:204](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L204)

Synthesizes text into a WAV audio clip.

#### Parameters

| Parameter | Type                                                                           | Description                                                                          |
| --------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `text`    | `string`                                                                       | The text to speak. Passed verbatim as the final positional arg / PowerShell literal. |
| `opts?`   | [`NativeSynthesizeOptions`](../../types/interfaces/NativeSynthesizeOptions.md) | Per-call options; each field overrides the constructor default of the same name.     |

#### Returns

`Promise`<[`GeneratedMediaOutput`](../../../../interfaces/GeneratedMediaOutput.md)>

A [GeneratedMediaOutput](../../../../interfaces/GeneratedMediaOutput.md) descriptor with `kind: 'audio'`, `mimeType: 'audio/wav'`,
the WAV bytes, and `filename: 'speech.wav'`.

#### Remarks

Resolves the platform (constructor `platform` or `process.platform`), the effective
voice/rate/pitch (per-call overrides ctor), the words-per-minute (for `say`/`espeak-ng`) and
the `-10..10` PowerShell rate (for win32), then shells out via the executor, reads the scratch
WAV back, hard-validates the RIFF/WAVE magic, and unlinks the scratch file in a `finally`.

#### Throws

[@nhtio/adk/batteries/tts/native!E\_NATIVE\_TTS\_UNSUPPORTED\_PLATFORM](../../exceptions/variables/E_NATIVE_TTS_UNSUPPORTED_PLATFORM.md) when the
resolved platform is not `darwin`/`linux`/`win32`.

#### Throws

[@nhtio/adk/batteries/tts/native!E\_NATIVE\_TTS\_TIMEOUT](../../exceptions/variables/E_NATIVE_TTS_TIMEOUT.md) when the binary is aborted
for exceeding `timeoutMs` (default 60\_000 ms).

#### Throws

[@nhtio/adk/batteries/tts/native!E\_NATIVE\_TTS\_ENGINE\_ERROR](../../exceptions/variables/E_NATIVE_TTS_ENGINE_ERROR.md) when the binary fails,
produces no output, or yields bytes that are not a RIFF/WAVE file.

***

### isAvailable()

```ts
static isAvailable(): boolean;
```

Defined in: [src/batteries/tts/native/adapter.ts:73](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/native/adapter.ts#L73)

Whether this battery is available. `true` whenever a Node `process` is present on a supported
[NativeTtsPlatform](../../types/type-aliases/NativeTtsPlatform.md) — the engine itself is the platform's own binary, so there is no peer
dependency to probe.

#### Returns

`boolean`
