---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tts/_shared/interfaces/RawAudioLike.md
description: >-
  The minimal structural slice of transformers.js's `RawAudio` the TTS engine
  consumes: a single `toBlob()` that encodes the synthesized samples to a WAV
  `Blob`.
---

# Interface: RawAudioLike

Defined in: [src/batteries/tts/\_shared/index.ts:89](https://github.com/NHTIO/ADK/blob/v1.20260718.0/src/src/batteries/tts/_shared/index.ts#L89)

The minimal structural slice of transformers.js's `RawAudio` the TTS engine consumes: a single
`toBlob()` that encodes the synthesized samples to a WAV `Blob`.

## Remarks

transformers.js `RawAudio.toBlob()` calls its internal `encodeWAV()` — a pure
`ArrayBuffer`/`DataView`/`Blob` path with `type: 'audio/wav'` — so it works in Node (Node ≥18 has
a global `Blob`) as well as the browser; it is NOT the browser-only path that `RawImage.toBlob()`
guards. `toBlob()` is the ONLY method the engine needs (it never reads raw `audio`/`sampling_rate`),
so this contract carries `toBlob` alone — the fake pipeline in unit tests implements exactly this.

## Methods

### toBlob()

```ts
toBlob(): Blob;
```

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

Encode the synthesized audio to a WAV `Blob` (`type: 'audio/wav'`).

#### Returns

`Blob`
