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

TTSOptions.md

103 lines2.1 KB

1---
2id: TTSOptions
3title: TTSOptions
4---
5​
6# Interface: TTSOptions\<TProviderOptions\>
7​
8Defined in: [packages/typescript/ai/src/types.ts:1617](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1617)
9​
10Options for text-to-speech generation.
11These are the common options supported across providers.
12​
13## Type Parameters
14​
15### TProviderOptions
16​
17`TProviderOptions` *extends* `object` = `object`
18​
19## Properties
20​
21### format?
22​
23```ts
24optional format: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";
25```
26​
27Defined in: [packages/typescript/ai/src/types.ts:1625](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1625)
28​
29The output audio format
30​
31***
32​
33### logger
34​
35```ts
36logger: InternalLogger;
37```
38​
39Defined in: [packages/typescript/ai/src/types.ts:1635](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1635)
40​
41Internal logger threaded from the generateSpeech() entry point. Adapters
42must call logger.request() before the SDK call and logger.errors() in
43catch blocks.
44​
45***
46​
47### model
48​
49```ts
50model: string;
51```
52​
53Defined in: [packages/typescript/ai/src/types.ts:1619](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1619)
54​
55The model to use for TTS generation
56​
57***
58​
59### modelOptions?
60​
61```ts
62optional modelOptions: TProviderOptions;
63```
64​
65Defined in: [packages/typescript/ai/src/types.ts:1629](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1629)
66​
67Model-specific options for TTS generation
68​
69***
70​
71### speed?
72​
73```ts
74optional speed: number;
75```
76​
77Defined in: [packages/typescript/ai/src/types.ts:1627](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1627)
78​
79The speed of the generated audio (0.25 to 4.0)
80​
81***
82​
83### text
84​
85```ts
86text: string;
87```
88​
89Defined in: [packages/typescript/ai/src/types.ts:1621](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1621)
90​
91The text to convert to speech
92​
93***
94​
95### voice?
96​
97```ts
98optional voice: string;
99```
100​
101Defined in: [packages/typescript/ai/src/types.ts:1623](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1623)
102​
103The voice to use for generation