Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

TTSOptions.md

103 lines2.1 KB

Interface: TTSOptions<TProviderOptions>

Defined in: packages/typescript/ai/src/types.ts:1617

Options for text-to-speech generation. These are the common options supported across providers.

Type Parameters

TProviderOptions

TProviderOptions extends object = object

Properties

format?

optional format: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";

Defined in: packages/typescript/ai/src/types.ts:1625

The output audio format


logger

logger: InternalLogger;

Defined in: packages/typescript/ai/src/types.ts:1635

Internal logger threaded from the generateSpeech() entry point. Adapters must call logger.request() before the SDK call and logger.errors() in catch blocks.


model

model: string;

Defined in: packages/typescript/ai/src/types.ts:1619

The model to use for TTS generation


modelOptions?

optional modelOptions: TProviderOptions;

Defined in: packages/typescript/ai/src/types.ts:1629

Model-specific options for TTS generation


speed?

optional speed: number;

Defined in: packages/typescript/ai/src/types.ts:1627

The speed of the generated audio (0.25 to 4.0)


text

text: string;

Defined in: packages/typescript/ai/src/types.ts:1621

The text to convert to speech


voice?

optional voice: string;

Defined in: packages/typescript/ai/src/types.ts:1623

The voice to use for generation